diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 6eafbda..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Build release - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - release: - name: Release - ${{ matrix.platform.release_for }} - strategy: - matrix: - platform: - - release_for: FreeBSD-x86_64 - os: ubuntu-latest - target: x86_64-unknown-freebsd - bin: fusioninventory-agent - name: fusioninventory-agent-FreeBSD-x86_64.tar.gz - command: build - - - release_for: Windows-x86_64 - os: windows-latest - target: x86_64-pc-windows-msvc - bin: fusioninventory-agent.exe - name: fusioninventory-agent-Windows-x86_64.zip - command: both - - # - release_for: macOS-x86_64 - # os: macOS-latest - # target: x86_64-apple-darwin - # bin: fusioninventory-agent - # name: fusioninventory-agent-Darwin-x86_64.tar.gz - # command: both - - - release_for: Linux-x86_64 - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - bin: fusioninventory-agent - name: fusioninventory-agent-Linux-x86_64.tar.gz - command: build - - runs-on: ${{ matrix.platform.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 - with: - command: ${{ matrix.platform.command }} - target: ${{ matrix.platform.target }} - args: "--locked --release" - cross-version: "19be83481fd3e50ea103d800d72e0f8eddb1c90c" - strip: true diff --git a/.github/workflows/test_build.yaml b/.github/workflows/test_build.yaml new file mode 100644 index 0000000..ce0d709 --- /dev/null +++ b/.github/workflows/test_build.yaml @@ -0,0 +1,124 @@ +name: Test & build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test_FreeBSD: + runs-on: ubuntu-latest + name: Test - FreeBSD + steps: + - uses: actions/checkout@v4 + - name: Run tests under FreeBSD + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + prepare: | + pkg install -y rust + run: | + cargo test + + test_others: + name: Test - ${{ matrix.platform.release_for }} + strategy: + matrix: + platform: + - release_for: Windows-x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: fusioninventory-agent.exe + name: fusioninventory-agent-Windows-x86_64.zip + command: test + + # - release_for: macOS-x86_64 + # os: macOS-latest + # target: x86_64-apple-darwin + # bin: fusioninventory-agent + # name: fusioninventory-agent-Darwin-x86_64.tar.gz + # command: both + + - release_for: Linux-x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + bin: fusioninventory-agent + name: fusioninventory-agent-Linux-x86_64.tar.gz + command: test + + # For rapsberry pi + # armv7-unknown-linux-gnueabihf + + runs-on: ${{ matrix.platform.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Rust cache + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: ${{ matrix.platform.command }} + target: ${{ matrix.platform.target }} + args: "--locked --release" + cross-version: "19be83481fd3e50ea103d800d72e0f8eddb1c90c" + strip: true + + build_FreeBSD: + runs-on: ubuntu-latest + name: Build - FreeBSD + steps: + - uses: actions/checkout@v4 + - name: Run tests under FreeBSD + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + prepare: | + pkg install -y rust + run: | + cargo build --locked --release + + build_others: + name: Build - ${{ matrix.platform.release_for }} + strategy: + matrix: + platform: + - release_for: Windows-x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: fusioninventory-agent.exe + name: fusioninventory-agent-Windows-x86_64.zip + command: build + + # - release_for: macOS-x86_64 + # os: macOS-latest + # target: x86_64-apple-darwin + # bin: fusioninventory-agent + # name: fusioninventory-agent-Darwin-x86_64.tar.gz + # command: both + + - release_for: Linux-x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + bin: fusioninventory-agent + name: fusioninventory-agent-Linux-x86_64.tar.gz + command: build + + # For rapsberry pi + # armv7-unknown-linux-gnueabihf + + runs-on: ${{ matrix.platform.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Rust cache + uses: Swatinem/rust-cache@v2 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: ${{ matrix.platform.command }} + target: ${{ matrix.platform.target }} + args: "--locked --release" + cross-version: "19be83481fd3e50ea103d800d72e0f8eddb1c90c" + strip: true diff --git a/Cargo.lock b/Cargo.lock index a80b7f4..426dd17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,9 +173,9 @@ checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" @@ -185,9 +185,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -203,9 +203,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" [[package]] name = "cfg-if" @@ -230,14 +230,14 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -245,9 +245,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -373,22 +373,11 @@ dependencies = [ "syn", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" @@ -500,6 +489,7 @@ dependencies = [ "sysinfo", "tokio", "toml", + "winreg", ] [[package]] @@ -728,9 +718,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -770,9 +760,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", @@ -789,33 +779,34 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "rustls", "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", + "webpki-roots", ] [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.0", "pin-project-lite", "socket2", "tokio", @@ -847,134 +838,14 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1034,9 +905,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -1050,12 +921,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -1068,9 +933,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loom" @@ -1116,9 +981,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -1231,9 +1096,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1270,7 +1135,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1348,9 +1213,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1368,6 +1233,53 @@ dependencies = [ "yansi", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -1502,9 +1414,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64", "bytes", @@ -1514,7 +1426,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-rustls", "hyper-util", "ipnet", @@ -1524,6 +1436,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", "rustls-pemfile", "rustls-pki-types", @@ -1644,6 +1557,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustix" version = "0.38.34" @@ -1659,11 +1578,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -1689,9 +1608,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring", "rustls-pki-types", @@ -1753,9 +1672,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "indexmap", "itoa", @@ -1854,12 +1773,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "state" version = "0.6.0" @@ -1877,15 +1790,15 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.66" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -1894,20 +1807,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "sysctl" @@ -2021,15 +1923,20 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.38.0" @@ -2062,9 +1969,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", @@ -2242,12 +2149,27 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-xid" version = "0.2.4" @@ -2262,27 +2184,15 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -2404,9 +2314,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -2458,7 +2368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2467,7 +2377,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2485,7 +2395,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2505,18 +2415,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2527,9 +2437,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -2539,9 +2449,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -2551,15 +2461,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -2569,9 +2479,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -2581,9 +2491,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -2593,9 +2503,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -2605,9 +2515,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -2628,18 +2538,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "yansi" version = "1.0.1" @@ -2649,75 +2547,8 @@ dependencies = [ "is-terminal", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index 83263a6..6a8ed1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,5 +34,8 @@ regex = "1.10.4" [target.'cfg(unix)'.dependencies] sysctl = "0.5.5" +[target.'cfg(windows)'.dependencies] +winreg = "0.52" + [[bin]] name = "fusioninventory-agent" diff --git a/src/common/webserver.rs b/src/common/webserver.rs index 8330e9b..4a82c11 100644 --- a/src/common/webserver.rs +++ b/src/common/webserver.rs @@ -160,8 +160,8 @@ pub fn rocket() -> Rocket { rocket::custom(figment) .mount("/", routes![status, default]) .mount("/now", routes![run_localinventory, run_networkdiscovery, run_networkinventory, run_deploy]) - .mount("/css", FileServer::from(relative!("src/static/webserver/css"))) - .mount("/img", FileServer::from(relative!("src/static/webserver/img"))) + .mount("/css", FileServer::from("static/webserver/css")) + .mount("/img", FileServer::from("static/webserver/img")) // create /api/status to have in json format } diff --git a/src/main.rs b/src/main.rs index 6bad43f..fa8a924 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,13 +55,6 @@ struct Args { } -struct NextTimes { - localinventory: u64, - networkdiscovery: u64, - networkinventory: u64, - deploy: u64, -} - fn main() { let args = Args::parse(); if args.debug || CONFIG.logging.logger_level == "debug" { diff --git a/src/module/localinventory/data/common.rs b/src/module/localinventory/data/common.rs new file mode 100644 index 0000000..29c097c --- /dev/null +++ b/src/module/localinventory/data/common.rs @@ -0,0 +1,106 @@ +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +pub fn clean_serial(serial: String) -> String { + match serial.to_lowercase().as_str() { + "to be filled by o.e.m." => "".to_string(), + "not specified" => "".to_string(), + "none" => "".to_string(), + _ => serial + } +} + +pub fn clean_string(data: String) -> String { + match data.to_lowercase().as_str() { + "unknown" => "".to_string(), + "not specified" => "".to_string(), + _ => data + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_clean_serial1() { + let data = "To Be Filled By O.E.M.".to_string(); + let result = clean_serial(data); + let expected = "".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_serial2() { + let data = "To Be Filled By O.E.M".to_string(); + let result = clean_serial(data); + let expected = "To Be Filled By O.E.M".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_serial3() { + let data = "XX6hty".to_string(); + let result = clean_serial(data); + let expected = "XX6hty".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_serial4() { + let data = "".to_string(); + let result = clean_serial(data); + let expected = "".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_string1() { + let data = "Unknown".to_string(); + let result = clean_string(data); + let expected = "".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_string2() { + let data = "unknown".to_string(); + let result = clean_string(data); + let expected = "".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_string3() { + let data = "XX6hty".to_string(); + let result = clean_string(data); + let expected = "XX6hty".to_string(); + + assert_eq!(result, expected); + } + + #[test] + fn test_clean_string4() { + let data = "".to_string(); + let result = clean_string(data); + let expected = "".to_string(); + + assert_eq!(result, expected); + } + +} \ No newline at end of file diff --git a/src/module/localinventory/data/cpu/dmidecode.rs b/src/module/localinventory/data/cpu/dmidecode.rs index 4932cfc..dfc24d3 100644 --- a/src/module/localinventory/data/cpu/dmidecode.rs +++ b/src/module/localinventory/data/cpu/dmidecode.rs @@ -10,142 +10,387 @@ // details. You should have received a copy of the GNU Affero General Public // License along with this program. If not, see . -use std::{fs::File, io::Read}; +use crate::module; + use nparse::*; use std::process::{Command, Stdio}; -use std::fs; - -pub fn run_inventory() -> serde_json::Value { - let path: String = std::env::temp_dir().join("dmidecode.txt").display().to_string(); - - let mut cachel1 = serde_json::json!(null); - let mut cachel2 = serde_json::json!(null); - let mut cachel3 = serde_json::json!(null); - - run_dmidecode_cmd(&path); - let mut out = String::new(); - { - let mut f = File::open(path.clone()).unwrap(); - f.read_to_string(&mut out).unwrap(); - } +use module::localinventory::structure::cpu::FinalProcessorStruct; +use regex::Regex; +use serde::{Deserialize}; +use module::localinventory::data::common; + +#[derive(Deserialize, Debug)] +struct ProcessorInformation { + // #[serde(rename = "Socket Designation")] + // socket_designation: Option, + // cputype: Option, + #[serde(rename = "Family")] + family: Option, + #[serde(rename = "Manufacturer")] + manufacturer: Option, + // flags: Vec, + // version: Option, + #[serde(rename = "Max Speed")] + max_speed: Option, + #[serde(rename = "Serial Number")] + serial_number: Option, + #[serde(rename = "Core Count")] + core_count: Option, + #[serde(rename = "Thread Count")] + thread_count: Option, + // characteristics: Vec, + id: Option, +} + +#[derive(Deserialize, Debug)] +struct CacheInformation { + #[serde(rename = "Socket Designation")] + socket_designation: Option, + #[serde(rename = "Configuration")] + configuration: Option, + #[serde(rename = "Installed Size")] + installed_size: Option, +} + +#[derive(Deserialize, Debug)] +struct DmidecodeCpu { + #[serde(rename = "Processor Information")] + processor_information: Option, + #[serde(rename = "Cache Information")] + cache_information: Option, +} + +pub fn run_inventory() -> Vec { + let out: String = run_dmidecode_cmd(); + parse_output(out) +} + +fn parse_output(out: String) -> Vec { + let mut index: i32 = 0; + let mut processors = Vec::new(); + // Fix for Windows + let out = out.replace("\r\n", "\n"); + + // get each part of dmidecode to identify processor / processors let parts = out.split("\n\n"); for part in parts { let result = part.to_string().indent_to_json(); let result = result.unwrap(); + let frvalue = serde_json::from_value(result); + if frvalue.is_err() { + continue; + } + let result: DmidecodeCpu = frvalue.unwrap(); - if result["Cache Information"]["Socket Designation"] == "L1 - Cache" { - cachel1 = result["Cache Information"]["Installed Size"].clone(); - } else if result["Cache Information"]["Socket Designation"] == "L2 - Cache" { - cachel2 = result["Cache Information"]["Installed Size"].clone(); - } else if result["Cache Information"]["Socket Designation"] == "L3 - Cache" { - cachel3 = result["Cache Information"]["Installed Size"].clone(); + // let result: DmidecodeCpu = serde_json::from_value(result.clone()).unwrap(); + if result.processor_information.is_some() { + processors.push(parse_processor(out.clone(), result.processor_information.unwrap(), index)); + index = index + 1; } } + return processors; +} - // load all to have processor - let result = out.indent_to_json(); - let result = result.unwrap(); - - let _ = delete_file(&path); - return serde_json::json!([ - { - "key": "manufacturer", - "value": result["Processor Information"]["Manufacturer"] - }, - { - "key": "id", - "value": result["Processor Information"]["ID"] - }, - { - "key": "family", - "value": result["Processor Information"]["Family"] - }, - { - "key": "speed", - "type": "integer", - "unit": "Mhz", - "value": result["Processor Information"]["Max Speed"] - }, - { - "key": "serialnumber", - "value": result["Processor Information"]["Serial Number"] - }, - { - "key": "corecount", - "type": "integer", - "value": result["Processor Information"]["Core Count"] - }, - { - "key": "threadcount", - "type": "integer", - "value": result["Processor Information"]["Thread Count"] - }, - { - "key": "flags", - "type": "list", - "value": [] // TODO - }, - { - "key": "characteristics", - "type": "list", - "value": [] // TODO - }, - { - "key": "L1 cache", - "type": "integer", - "value": cachel1 - }, - { - "key": "L2 cache", - "type": "integer", - "value": cachel2 - }, - { - "key": "L2 cache", - "type": "integer", - "value": cachel3 +fn parse_processor(out: String, processor: ProcessorInformation, index: i32) -> FinalProcessorStruct { + // get cache + let rel1: Regex = Regex::new(r"Level 1$").unwrap(); + let rel2: Regex = Regex::new(r"Level 2$").unwrap(); + let rel3: Regex = Regex::new(r"Level 3$").unwrap(); + let re_intunit: Regex = Regex::new(r"^(\d+) (\S+)$").unwrap(); + + let mut speed: i32 = 0; + let mut speed_unit: String = "".to_string(); + let mut l1cache_val: i32 = 0; + let mut l1cache_unit: String = "".to_string(); + let mut l2cache_val: i32 = 0; + let mut l2cache_unit: String = "".to_string(); + let mut l3cache_val: i32 = 0; + let mut l3cache_unit: String = "".to_string(); + + let parts = out.split("\n\n"); + for part in parts { + let result = part.to_string().indent_to_json(); + let result = result.unwrap(); + let frvalue = serde_json::from_value(result); + if frvalue.is_err() { + continue; + } + let result: DmidecodeCpu = frvalue.unwrap(); + // let result: DmidecodeCpu = serde_json::from_value(result).unwrap(); + if result.cache_information.is_some() { + let cache: CacheInformation = result.cache_information.unwrap(); + // if cache.configuration.is_some() { + let configuration = cache.configuration.unwrap_or_default(); + if let Some(mat) = rel1.captures(configuration.as_str()) { + if let Some(mat) = re_intunit.captures(cache.installed_size.unwrap_or_default().as_str()) { + l1cache_val = mat[1].trim().to_string().parse::().unwrap(); + l1cache_unit = mat[2].trim().to_string(); + } + } else if let Some(mat) = rel2.captures(configuration.as_str()) { + if let Some(mat) = re_intunit.captures(cache.installed_size.unwrap_or_default().as_str()) { + l2cache_val = mat[1].trim().to_string().parse::().unwrap(); + l2cache_unit = mat[2].trim().to_string(); + } + } else if let Some(mat) = rel3.captures(configuration.as_str()) { + if let Some(mat) = re_intunit.captures(cache.installed_size.unwrap_or_default().as_str()) { + l3cache_val = mat[1].trim().to_string().parse::().unwrap(); + l3cache_unit = mat[2].trim().to_string(); + } + } + // } } - ]); + } + + if let Some(mat) = re_intunit.captures(processor.max_speed.unwrap_or_default().as_str()) { + speed = mat[1].trim().to_string().parse::().unwrap(); + speed_unit = mat[2].trim().to_string(); + } + + FinalProcessorStruct { + manufacturer: common::clean_string(processor.manufacturer.unwrap_or_default()), + id: processor.id.unwrap_or_default(), + family: common::clean_string(processor.family.unwrap_or_default()), + speed: speed, + speed_unit: speed_unit, + serialnumber: common::clean_serial(processor.serial_number.unwrap_or_default()), + corecount: processor.core_count.unwrap_or_else(|| "1".to_string()).parse::().unwrap_or_default(), + threadcount: processor.thread_count.unwrap_or_default().parse::().unwrap_or_default(), + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: l1cache_val, + l1cache_unit: l1cache_unit, + l2cache: l2cache_val, + l2cache_unit: l2cache_unit, + l3cache: l3cache_val, + l3cache_unit: l3cache_unit, + } } #[cfg(target_os = "windows")] -fn run_dmidecode_cmd(path: &String) -> bool { - let file = File::create(path).unwrap(); - let stdio = Stdio::from(file); +fn run_dmidecode_cmd() -> String { + let cmd = "dmidecode.exe"; + let args = ["-qt", "processor", "-t", "cache"]; - let status = Command::new("dmidecode.exe").arg("-qt").arg("processor").arg(">").arg(path).stdout(stdio).status().expect("No such file or directory"); + let output = Command::new(cmd) + .args(&args) + .stdout(Stdio::piped()) + .output() + .expect("dmidecode.exe command error"); - if status.code() != Some(0) { - log::error!("dmidecode.exe command not found"); - return false; + // split + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, } - return true; } #[cfg(not(target_os = "windows"))] -fn run_dmidecode_cmd(path: &String) -> bool { - let file = File::create(path).unwrap(); - let stdio = Stdio::from(file); - +fn run_dmidecode_cmd() -> String { let cmd = "dmidecode"; let args = ["-qt", "processor", "-t", "cache"]; - let output = Command::new(cmd).args(&args).output(); - let output = output.unwrap(); - let output = String::from_utf8_lossy(&output.stdout[..]).to_string(); - let args = ["-qt", "processor", "-t", "cache"]; + let output = Command::new(cmd) + .args(&args) + .stdout(Stdio::piped()) + .output() + .expect("dmidecode command error"); - let status = Command::new("dmidecode").args(&args).arg(">").arg(path).stdout(stdio).status().expect("No such file or directory"); - - if status.code() != Some(0) { - log::error!("dmidecode command not found"); - return false; + // split + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, } - return true; } -fn delete_file(path: &String) -> std::io::Result<()> { - fs::remove_file(path)?; - Ok(()) +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_remi_srv() { + let data: String = std::fs::read_to_string("tests/localinventory/data/cpu/remi-srv.dat").unwrap(); + let result: Vec = parse_output(data); + + let mut expected = Vec::new(); + + expected.push(FinalProcessorStruct { + manufacturer: "Intel(R) Corporation".to_string(), + id: "".to_string(), + family: "Xeon".to_string(), + speed: 8300, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 4, + threadcount: 4, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 256, + l1cache_unit: "kB".to_string(), + l2cache: 1, + l2cache_unit: "MB".to_string(), + l3cache: 8, + l3cache_unit: "MB".to_string(), + }); + assert_eq!(result, expected); + } + + #[test] + fn test_parse_bi_cpu() { + let data: String = std::fs::read_to_string("tests/localinventory/data/cpu/bi-cpu.dat").unwrap(); + let result: Vec = parse_output(data); + + let mut expected = Vec::new(); + + expected.push(FinalProcessorStruct { + manufacturer: "Intel".to_string(), + id: "".to_string(), + family: "Xeon".to_string(), + speed: 4800, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 6, + threadcount: 12, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 192, + l1cache_unit: "kB".to_string(), + l2cache: 1536, + l2cache_unit: "kB".to_string(), + l3cache: 12, + l3cache_unit: "MB".to_string(), + }); + expected.push(FinalProcessorStruct { + manufacturer: "Intel".to_string(), + id: "".to_string(), + family: "Xeon".to_string(), + speed: 4800, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 6, + threadcount: 12, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 192, + l1cache_unit: "kB".to_string(), + l2cache: 1536, + l2cache_unit: "kB".to_string(), + l3cache: 12, + l3cache_unit: "MB".to_string(), + }); + assert_eq!(result, expected); + + } + + #[test] + fn test_parse_amd_zen() { + let data: String = std::fs::read_to_string("tests/localinventory/data/cpu/thinkpad_ddurieux.dat").unwrap(); + + let result: Vec = parse_output(data); + + let mut expected = Vec::new(); + + expected.push(FinalProcessorStruct { + manufacturer: "Advanced Micro Devices, Inc.".to_string(), + id: "".to_string(), + family: "Zen".to_string(), + speed: 4550, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 6, + threadcount: 12, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 384, + l1cache_unit: "kB".to_string(), + l2cache: 3, + l2cache_unit: "MB".to_string(), + l3cache: 16, + l3cache_unit: "MB".to_string(), + }); + assert_eq!(result, expected); + } + + #[test] + fn test_parse_8cpu_only_l1_cache() { + let data: String = std::fs::read_to_string("tests/localinventory/data/cpu/SKAVBE01.dat").unwrap(); + let result: Vec = parse_output(data); + + let mut expected = Vec::new(); + + for _ in 0..8 { + expected.push(FinalProcessorStruct { + manufacturer: "GenuineIntel".to_string(), + id: "".to_string(), + family: "".to_string(), + speed: 30000, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 1, + threadcount: 0, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 16, + l1cache_unit: "kB".to_string(), + l2cache: 0, + l2cache_unit: "kB".to_string(), + l3cache: 0, + l3cache_unit: "".to_string(), + }); + } + assert_eq!(result, expected); + } + + #[test] + fn test_parse_60cpu_no_cache() { + let data: String = std::fs::read_to_string("tests/localinventory/data/cpu/SFSVBE03.dat").unwrap(); + let result: Vec = parse_output(data); + + let mut expected = Vec::new(); + + for _ in 0..2 { + expected.push(FinalProcessorStruct { + manufacturer: "GenuineIntel".to_string(), + id: "".to_string(), + family: "".to_string(), + speed: 3139, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 1, + threadcount: 0, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 0, + l1cache_unit: "".to_string(), + l2cache: 0, + l2cache_unit: "".to_string(), + l3cache: 0, + l3cache_unit: "".to_string(), + }); + } + for _ in 0..58 { + expected.push(FinalProcessorStruct { + manufacturer: "".to_string(), + id: "".to_string(), + family: "".to_string(), + speed: 3139, + speed_unit: "MHz".to_string(), + serialnumber: "".to_string(), + corecount: 1, + threadcount: 0, + flags: Vec::new(), + characteristics: Vec::new(), + l1cache: 0, + l1cache_unit: "".to_string(), + l2cache: 0, + l2cache_unit: "".to_string(), + l3cache: 0, + l3cache_unit: "".to_string(), + }); + } + assert_eq!(result, expected); + } + } diff --git a/src/module/localinventory/data/filesystem/freebsd.rs b/src/module/localinventory/data/filesystem/freebsd.rs index 4c09c50..3aaa684 100644 --- a/src/module/localinventory/data/filesystem/freebsd.rs +++ b/src/module/localinventory/data/filesystem/freebsd.rs @@ -35,9 +35,12 @@ fn get_mounted() -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; + parse_output(data) +} +fn parse_output(data: String) -> Vec> { let mut filesystems: Vec> = Vec::new(); let re: Regex = Regex::new(r"^(\/dev[\w\/]+) on ([\w\/]+) \((\w+)").unwrap(); @@ -75,3 +78,21 @@ fn fill_properties(filesystems: Vec>) -> Vec> = parse_output(data); + let mut expected: Vec> = Vec::new(); + expected.push(HashMap::from([ + ("type".to_string(), "msdosfs".to_string()), + ("name".to_string(), "/boot/efi".to_string()), + ("partition".to_string(), "/dev/gpt/efiboot0".to_string()), + ])); + assert_eq!(result, expected); + } +} diff --git a/src/module/localinventory/data/filesystem/linux.rs b/src/module/localinventory/data/filesystem/linux.rs index 003cdfe..bfc10e4 100644 --- a/src/module/localinventory/data/filesystem/linux.rs +++ b/src/module/localinventory/data/filesystem/linux.rs @@ -33,7 +33,7 @@ fn get_mounted() -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; let mut filesystems: Vec> = Vec::new(); diff --git a/src/module/localinventory/data/mod.rs b/src/module/localinventory/data/mod.rs index 8dd13a8..5bc31f3 100644 --- a/src/module/localinventory/data/mod.rs +++ b/src/module/localinventory/data/mod.rs @@ -18,3 +18,4 @@ pub mod operatingsystem; pub mod software; pub mod volume; pub mod filesystem; +pub mod common; diff --git a/src/module/localinventory/data/operatingsystem/common.rs b/src/module/localinventory/data/operatingsystem/common.rs index edca9d4..41d6b12 100644 --- a/src/module/localinventory/data/operatingsystem/common.rs +++ b/src/module/localinventory/data/operatingsystem/common.rs @@ -48,7 +48,7 @@ pub fn get_boottime() -> u64 { pub fn get_timezone_name() -> String { match iana_time_zone::get_timezone() { Ok(name) => name, - Err(e) => String::from(""), + Err(_) => String::from(""), } } diff --git a/src/module/localinventory/data/operatingsystem/freebsd.rs b/src/module/localinventory/data/operatingsystem/freebsd.rs index ce3cab3..0595fe4 100644 --- a/src/module/localinventory/data/operatingsystem/freebsd.rs +++ b/src/module/localinventory/data/operatingsystem/freebsd.rs @@ -40,7 +40,7 @@ fn get_installation_date() -> String { let dt: DateTime = metadata.modified().unwrap().clone().into(); dt.format("%Y-%m-%d").to_string() }, - Err(e) => { + Err(_) => { String::from("") } } diff --git a/src/module/localinventory/data/partition/linux.rs b/src/module/localinventory/data/partition/linux.rs index 57620c2..6f7d61a 100644 --- a/src/module/localinventory/data/partition/linux.rs +++ b/src/module/localinventory/data/partition/linux.rs @@ -37,7 +37,7 @@ fn load_lshw_data_json() -> Vec { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; let parts: Vec = serde_json::from_str(&data).expect("JSON was not well-formatted in lshw output command"); diff --git a/src/module/localinventory/data/physicaldisk/linux.rs b/src/module/localinventory/data/physicaldisk/linux.rs index 7e196be..15a9c33 100644 --- a/src/module/localinventory/data/physicaldisk/linux.rs +++ b/src/module/localinventory/data/physicaldisk/linux.rs @@ -31,7 +31,7 @@ fn load_lshw_data_json() -> Vec { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; let disks: Vec = serde_json::from_str(&data).expect("JSON was not well-formatted in lshw output command"); diff --git a/src/module/localinventory/data/software/common.rs b/src/module/localinventory/data/software/common.rs new file mode 100644 index 0000000..0c36e31 --- /dev/null +++ b/src/module/localinventory/data/software/common.rs @@ -0,0 +1,41 @@ +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use regex::Regex; + +pub fn clean_name(name: String) -> String { + // TODO try use github.com/rust-ml/linfa + // intel MKL is only the one run on windows, linux and macos + + + + + + let re: Regex = Regex::new(r"^([a-zA-Z\-]+)([\-\d\.]+)$").unwrap(); + let redash: Regex = Regex::new(r"(.*)\-$").unwrap(); + if let Some(mat) = re.captures(name.as_str()) { + if let Some(matdash) = redash.captures(mat[1].trim()) { + return matdash[1].trim().to_string(); + } + return mat[1].trim().to_string(); + } + return name; +} + +pub fn clean_version(version: String) -> String { + + let re: Regex = Regex::new(r"^(\S*)([\-\d\.]+)$").unwrap(); + if let Some(mat) = re.captures(version.as_str()) { + return mat[1].trim().to_string(); + } + return version; +} diff --git a/src/module/localinventory/data/software/freebsd.rs b/src/module/localinventory/data/software/freebsd.rs index efc04f1..295897e 100644 --- a/src/module/localinventory/data/software/freebsd.rs +++ b/src/module/localinventory/data/software/freebsd.rs @@ -11,18 +11,44 @@ // details. You should have received a copy of the GNU Affero General Public // License along with this program. If not, see . +use crate::module; use std::process::{Command, Stdio}; -// use chrono::prelude::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; +use chrono::prelude::DateTime; +use chrono::Utc; +use serde_json::error::Category; +use std::time::{UNIX_EPOCH, Duration}; +use module::localinventory::structure::software::FinalPackageStruct; -pub fn run_inventory() -> Vec { + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct AnnotationsStruct { + repository: Option, +} + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + www: String, + annotations: Option, + categories: Vec, + timestamp: u64, +} + +pub fn run_inventory() -> Vec { let packages = load_from_pkg(); fill_properties(packages) } -fn load_from_pkg() -> Vec { +fn load_from_pkg() -> Vec { - let mut packages = Vec::new(); let cmd = "pkg"; let args = ["info", "--raw", "--raw-format", "json-compact", "--all"]; @@ -34,90 +60,173 @@ fn load_from_pkg() -> Vec { // split let empty = String::from(""); - let linesstr = match String::from_utf8(output.stdout) { + let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; + parse_output(data) +} + +fn parse_output(data: String) -> Vec { + let mut packages: Vec = Vec::new(); - let lines = linesstr.lines(); - for line in lines { + for line in data.lines() { if line != "" { - let json_test: serde_json::Value = serde_json::from_str(line).expect("JSON was not well-formatted line by line"); - packages.push(json_test); - } - } + // TODO on some versions, not have line by line, so split by }{ + let parts = line.split("}{"); + let cnt = parts.clone().count(); + if cnt == 1 { + let pkg_software: PackageStruct = serde_json::from_str::(line).expect("JSON was not well-formatted line by line"); + packages.push(pkg_software); + + } else if cnt > 1 { + let mut index = 0; + for part in parts { + index = index + 1; + let mut newline; + if index == 1 { + newline = format!("{}{}", part, "}"); + } else if index == cnt { + newline = format!("{}{}", "{", part); + } else { + newline = format!("{}{}{}", "{", part, "}"); + } - // TODO split each line and read json - // serde_json::from_str(&String::from_utf8_lossy(&output.stdout)).expect("JSON was not well-formatted") - // serde_json::from_slice(output.stdout.as_slice()).expect("JSON was not well-formatted") + let pkg_software: PackageStruct = serde_json::from_str::(newline.as_str()).expect("JSON was not well-formatted line by line"); + packages.push(pkg_software); + + } + } + } + } return packages; } -fn fill_properties(packages: Vec) -> Vec { +fn fill_properties(packages: Vec) -> Vec { let mut softwares = Vec::new(); for package in packages { // let installationdate: DateTime = package["timestamp"]; - let data = serde_json::json!([ - { - "key": "cleanedname", - "value": package["name"], - }, - { - "key": "version", - "value": package["version"], - }, - { - "key": "publisher", - "value": "", - }, - { - "key": "maintainer", - "value": package["maintainer"], - }, - { - "key": "source", - "value": package["annotations"]["repository"], - }, - { - "key": "type", - "value": "", + let mut repository = "".to_string(); + match package.annotations { + Some(x) => { + match x.repository { + Some(y) => repository = y, + None => repository = "".to_string(), + } }, - { - "key": "architecture", - "value": package["arch"], - }, - { - "key": "category", - "value": package["categories"][0], - }, - { - "key": "installationdate", - "value": "", // installationdate.format("%Y-%m-%d").to_string(), + None => repository = "".to_string(), + } + let d = UNIX_EPOCH + Duration::from_secs(package.timestamp); + let installdate = DateTime::::from(d); + let mut uninstallcommand = String::from("pkg delete -f "); + uninstallcommand.push_str(package.name.as_str()); + let data: FinalPackageStruct = FinalPackageStruct { + name: package.name.clone(), + originalname: package.name, + version: package.version.clone(), + revision: "".to_string(), + originalversion: package.version, + publisher: "".to_string(), + maintainer: package.maintainer, + repository: repository, + pkgtype: "pkg".to_string(), + architecture: package.arch, + category: "".to_string(), + installationdate: installdate.format("%Y-%m-%d").to_string(), + uninstallcommand: uninstallcommand, + id: "".to_string(), + comment: package.comment, + mainurl: package.www, + helpurl: "".to_string(), + }; + softwares.push(data); + } + return softwares; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_output() { + let data: String = std::fs::read_to_string("tests/localinventory/data/software/freebsd_pkg.dat").unwrap(); + // load data json of pkg from file because directly here is difficult + let result: Vec = parse_output(data); + let mut expected: Vec = Vec::new(); + expected.push(serde_json::from_value(serde_json::json!({ + "name": "Box2D", + "version": "2.4.1", + "maintainer": "yuri@FreeBSD.org", + "arch": "freebsd:14:x86:64", + "comment": "2D physics engine for games", + "www": "https://box2d.org/", + "annotations": { + "repository": "durieux_family_poudriere" }, - { - "key": "uninstallcommand", - "value": String::from("pkg delete -f").push_str(&package["name"].to_string()), + "categories": ["misc"], + "timestamp": 1709152837, + })).unwrap()); + + expected.push(serde_json::from_value(serde_json::json!({ + "name": "GentiumBasic", + "version": "1102_1", + "maintainer": "matthew@FreeBSD.org", + "arch": "freebsd:14:*", + "comment": "Gentium Basic and Gentium Book Basic TrueType fonts", + "www": "https://software.sil.org/gentium/", + "annotations": { + "repository": "durieux_family_poudriere" }, - { - "key": "guid", - "value": "", + "categories": ["x11-fonts"], + "timestamp": 1709152837, + })).unwrap()); + + expected.push(serde_json::from_value(serde_json::json!({ + "name": "Imath", + "version": "3.1.10", + "maintainer": "mandree@FreeBSD.org", + "arch": "freebsd:14:x86:64", + "comment": "C++/Python lib of 2D/3D vector, matrix, math ops for computer graphics", + "www": "https://github.com/AcademySoftwareFoundation/Imath/", + "annotations": { + "repository": "durieux_family_poudriere" }, - { - "key": "comment", - "value": package["comment"], + "categories": ["math","graphics","devel"], + "timestamp": 1709152565, + })).unwrap()); + + expected.push(serde_json::from_value(serde_json::json!({ + "name": "aalib", + "version": "1.4.r5_14", + "maintainer": "ports@FreeBSD.org", + "arch": "freebsd:14:x86:64", + "comment": "ASCII art library", + "www": "https://aa-project.sourceforge.net/aalib/", + "annotations": { + "repository": "durieux_family_poudriere" }, - { - "key": "mainurl", - "value": package["www"], + "categories": ["graphics"], + "timestamp": 1710580344, + })).unwrap()); + + expected.push(serde_json::from_value(serde_json::json!({ + "name": "bsddialog", + "version": "1.0.1", + "maintainer": "alfix86@gmail.com", + "arch": "freebsd:14:x86:64", + "comment": "Text User Interface Widgets", + "www": "https://gitlab.com/alfix/bsddialog", + "annotations": { + "repository": null }, - { - "key": "helpurl", - "value": "", - } - ]); - softwares.push(data); + "categories": ["devel"], + "timestamp": 1714125640, + })).unwrap()); + + assert_eq!(result, expected); + } - return softwares; } diff --git a/src/module/localinventory/data/software/linux.rs b/src/module/localinventory/data/software/linux.rs deleted file mode 100644 index 7ccdcd1..0000000 --- a/src/module/localinventory/data/software/linux.rs +++ /dev/null @@ -1,198 +0,0 @@ -#![cfg(target_os = "linux")] -// Copyright (C) 2024 FusionSuite Team -// -// This program is free software: you can redistribute it and/or modify it under -// the terms of the GNU Affero General Public License as published by the Free -// Software Foundation, version 3. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more -// details. You should have received a copy of the GNU Affero General Public -// License along with this program. If not, see . - - -use std::process::{Command, Stdio}; -use std::collections::HashMap; - -pub fn run_inventory() -> Vec { - // https://github.com/sigoden/upt - - load_from_package_manager() -} - -fn load_from_package_manager() -> Vec { - // let data = get_dpkg(); - // println!("dpkg return: {:?}", data); - let output = get_rpm(); - // println!("rpm return: {:?}", output); - let data = parse_rpm_output(output); - - fill_properties(data) -} - -fn get_dpkg() -> Option { - // https://crates.io/crates/dpkg-query-json - let args = [ - "--show", - "--showformat='${Package}\t\t${Architecture}\t\t${Version}\t\t${Installed-Size}\t\t${Section}\t\t${Status}\t\t${Homepage}\t\t${Maintainer}\t\t${binary:Summary}\n" - ]; - let output = match Command::new("dpkg-query") - .args(args) - .stdout(Stdio::piped()) - .output() - { - Ok(output) => { - if output.status.success() { - match String::from_utf8(output.stdout) { - Ok(x) => { - return Some(x); - }, - Err(_) => "".to_string(), - } - } else { - return Some("".to_string()); - } - }, - _ => { - log::debug!("apt not found, next package manager"); - return Some("".to_string()); - }, - }; - None -} - -fn get_rpm() -> String { - let args = [ - "-qa", - "--queryformat", - "%{NAME}\t\t%{ARCH}\t\t%{VERSION}-%{RELEASE}\t\t%{INSTALLTIME}\t\t%{VENDOR}\t\t%{SUMMARY}\t\t%{GROUP}\t\t%{PACKAGER}\t\t%{URL}\t\t%{BUGURL}\t\t%{PKGID}\n" - ]; - let output = Command::new("rpm") - .args(args) - .stdout(Stdio::piped()) - .output() - .expect("rpm command error"); - - let empty = String::from(""); - let data = match String::from_utf8(output.stdout) { - Ok(x) => x, - Err(e) => empty, - }; - - return data; -} - -fn parse_rpm_output(output: String) -> Vec> { - let mut softwares = Vec::new(); - // split each line (each line is a software) - let parts = output.split("\n"); - for part in parts { - // split - let pp: String = part.to_string(); - // let mut software_info = pp.split("\t\t"); - let software_info: Vec<&str> = pp.split("\t\t").collect(); - let mut soft = HashMap::new(); - if software_info.iter().count() < 11 { - continue; - } - - soft.insert(String::from("name"), software_info[0].to_string().clone()); - soft.insert(String::from("arch"), software_info[1].to_string().clone()); - soft.insert(String::from("version"), software_info[2].to_string().clone()); - soft.insert(String::from("installationdate"), software_info[3].to_string().clone()); - soft.insert(String::from("publisher"), software_info[4].to_string().clone()); - soft.insert(String::from("comment"), software_info[5].to_string().clone()); - soft.insert(String::from("maintainer"), software_info[7].to_string().clone()); - soft.insert(String::from("mainurl"), software_info[8].to_string().clone()); - soft.insert(String::from("helpurl"), software_info[9].to_string().clone()); - // it''s more id than uuid - soft.insert(String::from("guid"), software_info[10].to_string().clone()); - softwares.push(soft); - } - return softwares; -} - -fn fill_properties(packages: Vec>) -> Vec { - - let mut softwares = Vec::new(); - for package in packages { - // let installationdate: DateTime = package["timestamp"]; - let data = serde_json::json!([ - { - "key": "cleanedname", - "value": package.get("name"), - }, - { - "key": "version", - "value": package.get("version"), - }, - { - "key": "publisher", - "value": package.get("publisher"), - }, - { - "key": "maintainer", - "value": package.get("maintainer"), - }, - { - "key": "source", - "value": "", - }, - { - "key": "type", - "value": "", - }, - { - "key": "architecture", - "value": package["arch"], - }, - { - "key": "category", - "value": "", - }, - { - "key": "installationdate", - "value": package.get("installationdate"), // .format("%Y-%m-%d").to_string(), // installationdate.format("%Y-%m-%d").to_string(), - }, - { - "key": "uninstallcommand", - "value": "", - }, - { - "key": "guid", - "value": package.get("guid"), - }, - { - "key": "comment", - "value": package["comment"], - }, - { - "key": "mainurl", - "value": package["mainurl"], - }, - { - "key": "helpurl", - "value": package["helpurl"], - } - ]); - softwares.push(data); - } - return softwares; -} - -#[cfg(test)] -mod tests { - - #[test] - fn parse_rpm_output() { - // load data from file tests/software_rpm.data - - // send it in parser function - - - // verify content converted - - - } -} \ No newline at end of file diff --git a/src/module/localinventory/data/software/linux/dpkg.rs b/src/module/localinventory/data/software/linux/dpkg.rs new file mode 100644 index 0000000..82d478f --- /dev/null +++ b/src/module/localinventory/data/software/linux/dpkg.rs @@ -0,0 +1,106 @@ +#![cfg(target_os = "linux")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use crate::module; + +use std::process::{Command, Stdio}; +use serde::{Deserialize, Serialize}; +use module::localinventory::structure::software::FinalPackageStruct; + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + mainurl: String, + helpurl: String, + timestamp: u64, + publisher: String, + guid: String, +} + +pub fn run_inventory() -> Vec { + let output_apt = get_dpkg(); + parse_dpkg_output(output_apt) +} + +fn get_dpkg() -> String { + // https://crates.io/crates/dpkg-query-json + let args = [ + "--show", + "--showformat='${Package}\t\t${Architecture}\t\t${Version}\t\t${Installed-Size}\t\t${Section}\t\t${Status}\t\t${Homepage}\t\t${Maintainer}\t\t${binary:Summary}\n" + ]; + match Command::new("dpkg-query") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(e) => { + println!("dpkg command error: {:?}", e); + "".to_string() + } + } +} + +fn parse_dpkg_output(output: String) -> Vec { + let mut softwares: Vec = Vec::new(); + // split each line (each line is a software) + let parts = output.split("\n"); + for part in parts { + // split + let pp: String = part.to_string(); + // let mut software_info = pp.split("\t\t"); + let software_info: Vec<&str> = pp.split("\t\t").collect(); + // let mut soft = HashMap::new(); + if software_info.iter().count() < 11 { + continue; + } + + let my_software: FinalPackageStruct = FinalPackageStruct { + name: software_info[0].to_string().clone(), + originalname: software_info[0].to_string().clone(), + version: software_info[2].to_string().clone(), + revision: "".to_string(), + originalversion: software_info[2].to_string().clone(), + publisher: "".to_string(), + maintainer: software_info[7].to_string().clone(), + repository: "".to_string(), + pkgtype: "".to_string(), + architecture: software_info[1].to_string().clone(), + category: "".to_string(), + installationdate: "".to_string(), + uninstallcommand: "".to_string(), + id: "".to_string(), + comment: software_info[8].to_string().clone(), + mainurl: software_info[6].to_string().clone(), + helpurl: "".to_string(), + }; + softwares.push(my_software); + } + return softwares; +} + +#[cfg(test)] +mod tests { + use super::*; + +} diff --git a/src/module/localinventory/data/software/linux/mod.rs b/src/module/localinventory/data/software/linux/mod.rs new file mode 100644 index 0000000..3189338 --- /dev/null +++ b/src/module/localinventory/data/software/linux/mod.rs @@ -0,0 +1,17 @@ +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +pub mod dpkg; +pub mod rpm; +pub mod pacman; +pub mod nix; +pub mod snap; diff --git a/src/module/localinventory/data/software/linux/nix.rs b/src/module/localinventory/data/software/linux/nix.rs new file mode 100644 index 0000000..2743ad8 --- /dev/null +++ b/src/module/localinventory/data/software/linux/nix.rs @@ -0,0 +1,115 @@ +#![cfg(target_os = "linux")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use crate::module; + +use std::process::{Command, Stdio}; +use serde::{Deserialize, Serialize}; +use module::localinventory::structure::software::FinalPackageStruct; +use chrono::prelude::DateTime; +use chrono::Utc; +use std::time::{UNIX_EPOCH, Duration}; + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + mainurl: String, + helpurl: String, + timestamp: u64, + publisher: String, + guid: String, +} + +pub fn run_inventory() -> Vec { + let output_nix = get_nix(); + parse_nix_output(output_nix) +} + +fn get_nix() -> String { + let args = [ + "--gc", + "--print-live" + ]; + match Command::new("nix-store") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(_) => { + println!("nix-store command error"); + "".to_string() + } + } +} + +fn parse_nix_output(output: String) -> Vec { + let mut softwares: Vec = Vec::new(); + // split each line (each line is a software) + let parts = output.split("\n"); + for part in parts { + // split + let pp: String = part.to_string(); + // let mut software_info = pp.split("\t\t"); + let software_info: Vec<&str> = pp.split("\t\t").collect(); + // let mut soft = HashMap::new(); + if software_info.iter().count() < 11 { + continue; + } + // let mut installdate = "".to_string(); + // match software_info[4].to_string().clone().parse::() { + // Ok(t) => { + // let d = UNIX_EPOCH + Duration::from_secs(t); + // installdate = DateTime::::from(d).format("%Y-%m-%d").to_string(); + // }, + // Err(e) => println!("err on timestamp {:?}", e) + // } + + let my_software: FinalPackageStruct = FinalPackageStruct { + name: "".to_string(), // software_info[0].to_string().clone(), + originalname: "".to_string(), + version: "".to_string(), + revision: "".to_string(), + originalversion: "".to_string(), + publisher: "".to_string(), + maintainer: "".to_string(), + repository: "".to_string(), + pkgtype: "nix".to_string(), + architecture: "".to_string(), + category: "".to_string(), + installationdate: "".to_string(), + uninstallcommand: "".to_string(), + id: "".to_string(), + comment: "".to_string(), + mainurl: "".to_string(), + helpurl: "".to_string(), + }; + softwares.push(my_software); + } + return softwares; +} + +#[cfg(test)] +mod tests { + use super::*; +} diff --git a/src/module/localinventory/data/software/linux/pacman.rs b/src/module/localinventory/data/software/linux/pacman.rs new file mode 100644 index 0000000..7a9c9fc --- /dev/null +++ b/src/module/localinventory/data/software/linux/pacman.rs @@ -0,0 +1,114 @@ +#![cfg(target_os = "linux")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use crate::module; + +use std::process::{Command, Stdio}; +use serde::{Deserialize, Serialize}; +use module::localinventory::structure::software::FinalPackageStruct; +use chrono::prelude::DateTime; +use chrono::Utc; +use std::time::{UNIX_EPOCH, Duration}; + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + mainurl: String, + helpurl: String, + timestamp: u64, + publisher: String, + guid: String, +} + +pub fn run_inventory() -> Vec { + let output_pacman = get_pacman(); + parse_pacman_output(output_pacman) +} + +fn get_pacman() -> String { + let args = [ + "-Qqi" + ]; + match Command::new("pacman") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(_) => { + println!("pacman command error"); + "".to_string() + } + } +} + +fn parse_pacman_output(output: String) -> Vec { + let mut softwares: Vec = Vec::new(); + // split each line (each line is a software) + let parts = output.split("\n"); + for part in parts { + // split + let pp: String = part.to_string(); + // let mut software_info = pp.split("\t\t"); + let software_info: Vec<&str> = pp.split("\t\t").collect(); + // let mut soft = HashMap::new(); + if software_info.iter().count() < 11 { + continue; + } + // let mut installdate = "".to_string(); + // match software_info[4].to_string().clone().parse::() { + // Ok(t) => { + // let d = UNIX_EPOCH + Duration::from_secs(t); + // installdate = DateTime::::from(d).format("%Y-%m-%d").to_string(); + // }, + // Err(e) => println!("err on timestamp {:?}", e) + // } + + let my_software: FinalPackageStruct = FinalPackageStruct { + name: "".to_string(), // software_info[0].to_string().clone(), + originalname: "".to_string(), + version: "".to_string(), + revision: "".to_string(), + originalversion: "".to_string(), + publisher: "".to_string(), + maintainer: "".to_string(), + repository: "".to_string(), + pkgtype: "pacman".to_string(), + architecture: "".to_string(), + category: "".to_string(), + installationdate: "".to_string(), + uninstallcommand: "".to_string(), + id: "".to_string(), + comment: "".to_string(), + mainurl: "".to_string(), + helpurl: "".to_string(), + }; + softwares.push(my_software); + } + return softwares; +} + +#[cfg(test)] +mod tests { + use super::*; +} diff --git a/src/module/localinventory/data/software/linux/rpm.rs b/src/module/localinventory/data/software/linux/rpm.rs new file mode 100644 index 0000000..91dcbc7 --- /dev/null +++ b/src/module/localinventory/data/software/linux/rpm.rs @@ -0,0 +1,185 @@ +#![cfg(target_os = "linux")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use crate::module; + +use std::process::{Command, Stdio}; +use serde::{Deserialize, Serialize}; +use module::localinventory::structure::software::FinalPackageStruct; +use chrono::prelude::DateTime; +use chrono::Utc; +use std::time::{UNIX_EPOCH, Duration}; + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + mainurl: String, + helpurl: String, + timestamp: u64, + publisher: String, + guid: String, +} + +pub fn run_inventory() -> Vec { + let output_rpm = get_rpm(); + parse_rpm_output(output_rpm) +} + +fn get_rpm() -> String { + let args = [ + "-qa", + "--queryformat", + "%{NAME}\t\t%{ARCH}\t\t%{VERSION}\t\t%{RELEASE}\t\t%{INSTALLTIME}\t\t%{VENDOR}\t\t%{SUMMARY}\t\t%{GROUP}\t\t%{PACKAGER}\t\t%{URL}\t\t%{BUGURL}\t\t%{PKGID}\n" + ]; + match Command::new("rpm") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(_) => { + println!("rpm command error"); + "".to_string() + } + } +} + +fn parse_rpm_output(output: String) -> Vec { + let mut softwares: Vec = Vec::new(); + // split each line (each line is a software) + let parts = output.split("\n"); + for part in parts { + // split + let pp: String = part.to_string(); + // let mut software_info = pp.split("\t\t"); + let software_info: Vec<&str> = pp.split("\t\t").collect(); + // let mut soft = HashMap::new(); + if software_info.iter().count() < 11 { + continue; + } + let mut installdate = "".to_string(); + match software_info[4].to_string().clone().parse::() { + Ok(t) => { + let d = UNIX_EPOCH + Duration::from_secs(t); + installdate = DateTime::::from(d).format("%Y-%m-%d").to_string(); + }, + Err(e) => println!("err on timestamp {:?}", e) + } + + let my_software: FinalPackageStruct = FinalPackageStruct { + name: software_info[0].to_string().clone(), + originalname: software_info[0].to_string().clone(), + version: software_info[2].to_string().clone(), + revision: software_info[3].to_string().clone(), + originalversion: software_info[2].to_string().clone(), + publisher: "".to_string(), + maintainer: software_info[8].to_string().clone(), + repository: software_info[5].to_string().clone(), + pkgtype: "rpm".to_string(), + architecture: software_info[1].to_string().clone(), + category: "".to_string(), + installationdate: installdate, + uninstallcommand: "".to_string(), + id: software_info[11].to_string().clone(), + comment: software_info[6].to_string().clone(), + mainurl: software_info[9].to_string().clone(), + helpurl: software_info[10].to_string().clone(), + }; + softwares.push(my_software); + } + return softwares; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_rpm_output() { + let data: String = std::fs::read_to_string("tests/localinventory/data/software/fedora_rpm.dat").unwrap(); + let result: Vec = parse_rpm_output(data); + let mut expected: Vec = Vec::new(); + + expected.push(FinalPackageStruct { + name: "libgcc".to_string(), + originalname: "libgcc".to_string(), + version: "14.1.1".to_string(), + revision: "5.fc40".to_string(), + originalversion: "14.1.1".to_string(), + publisher: "".to_string(), + maintainer: "Fedora Project".to_string(), + repository: "Fedora Project".to_string(), + pkgtype: "rpm".to_string(), + architecture: "x86_64".to_string(), + category: "".to_string(), + installationdate: "2024-06-15".to_string(), + uninstallcommand: "".to_string(), + id: "499b0b8f20a953dfe935e85bd93a1cb2".to_string(), + comment: "GCC version 14 shared support library".to_string(), + mainurl: "http://gcc.gnu.org".to_string(), + helpurl: "https://bugz.fedoraproject.org/gcc".to_string(), + }); + + expected.push(FinalPackageStruct { + name: "fonts-filesystem".to_string(), + originalname: "fonts-filesystem".to_string(), + version: "2.0.5".to_string(), + revision: "14.fc40".to_string(), + originalversion: "2.0.5".to_string(), + publisher: "".to_string(), + maintainer: "Fedora Project".to_string(), + repository: "Fedora Project".to_string(), + pkgtype: "rpm".to_string(), + architecture: "noarch".to_string(), + category: "".to_string(), + installationdate: "2024-06-15".to_string(), + uninstallcommand: "".to_string(), + id: "468b8f3f8c2d1e4c10f0c3f4f4e736c3".to_string(), + comment: "Directories used by font packages".to_string(), + mainurl: "https://docs.fedoraproject.org/en-US/packaging-guidelines/FontsPolicy/".to_string(), + helpurl: "https://bugz.fedoraproject.org/fonts-rpm-macros".to_string(), + }); + + expected.push(FinalPackageStruct { + name: "xkeyboard-config".to_string(), + originalname: "xkeyboard-config".to_string(), + version: "2.41".to_string(), + revision: "1.fc40".to_string(), + originalversion: "2.41".to_string(), + publisher: "".to_string(), + maintainer: "Fedora Project".to_string(), + repository: "Fedora Project".to_string(), + pkgtype: "rpm".to_string(), + architecture: "noarch".to_string(), + category: "".to_string(), + installationdate: "2024-06-15".to_string(), + uninstallcommand: "".to_string(), + id: "2935adee5a077f929fceb628bd4cb113".to_string(), + comment: "X Keyboard Extension configuration data".to_string(), + mainurl: "http://www.freedesktop.org/wiki/Software/XKeyboardConfig".to_string(), + helpurl: "https://bugz.fedoraproject.org/xkeyboard-config".to_string(), + }); + + assert_eq!(result, expected); + } +} diff --git a/src/module/localinventory/data/software/linux/snap.rs b/src/module/localinventory/data/software/linux/snap.rs new file mode 100644 index 0000000..5014116 --- /dev/null +++ b/src/module/localinventory/data/software/linux/snap.rs @@ -0,0 +1,247 @@ +// #![cfg(target_os = "linux")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +use crate::module; + +use std::process::{Command, Stdio}; +use serde::{Deserialize, Serialize}; +use module::localinventory::structure::software::FinalPackageStruct; +use chrono::prelude::DateTime; +use chrono::Utc; +use std::time::{UNIX_EPOCH, Duration}; +use regex::Regex; + +#[derive(Serialize, Deserialize, Debug)] +#[derive(PartialEq)] +struct PackageStruct { + name: String, + version: String, + maintainer: String, + arch: String, + comment: String, + mainurl: String, + helpurl: String, + timestamp: u64, + publisher: String, + guid: String, +} + +pub fn run_inventory() -> Vec { + let output_snap = get_snap_list(); + // parse_snap_package("losslesscut".to_string()) + let data: Vec = Vec::new(); + return data; +} + +fn get_snap_list() -> String { + let args = [ + "list", + "--color", + "never" + ]; + match Command::new("snap") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(_) => { + println!("snap list command error"); + "".to_string() + } + } +} + +fn get_snap_package(packagename: String) -> String { + let args = [ + "info", + "--color", + "never", + "--abs-time", + packagename.as_str() + ]; + match Command::new("snap") + .args(args) + .stdout(Stdio::piped()) + .output() { + Ok(output) => { + let empty = String::from(""); + match String::from_utf8(output.stdout) { + Ok(x) => x, + Err(_) => empty, + } + }, + Err(_) => { + println!("snap info command error"); + "".to_string() + } + } + +} + +fn parse_snap_extract_packagename(output: String) -> Vec { + let mut names = Vec::new(); + + let re: Regex = Regex::new(r"^(\S*)").unwrap(); + for line in output.lines() { + if let Some(mat) = re.captures(line) { + if mat[1].trim().to_string() == "Name" { + continue; + } + names.push(mat[1].trim().to_string()); + } + } + return names; +} + +fn parse_snap_package(output: String) -> FinalPackageStruct { + // TODO + let mut softwares: Vec = Vec::new(); + // split each line (each line is a software) + let parts = output.split("\n"); + let mut name = "".to_string(); + let mut comment = "".to_string(); + let mut publisher = "".to_string(); + let mut mainurl = "".to_string(); + let mut id = "".to_string(); + let mut version = "".to_string(); + + let re: Regex = Regex::new(r"^(name|summary|publisher|store-url|snap-id)\:(?:\s*)([\S ]*)").unwrap(); + let re_installed: Regex = Regex::new(r"^installed\:(?:\s*)([\S]*)").unwrap(); + + for part in parts { + // split + let pp: String = part.to_string(); + // let mut software_info = pp.split("\t\t"); + for line in output.lines() { + if let Some(mat) = re.captures(line) { + if mat[1].trim().to_string() == "name" { + name = mat[2].trim().to_string(); + } + if mat[1].trim().to_string() == "summary" { + comment = mat[2].trim().to_string(); + } + if mat[1].trim().to_string() == "publisher" { + publisher = mat[2].trim().to_string(); + } + if mat[1].trim().to_string() == "store-url" { + mainurl = mat[2].trim().to_string(); + } + if mat[1].trim().to_string() == "snap-id" { + id = mat[2].trim().to_string(); + } + } else if let Some(mat) = re_installed.captures(line) { + version = mat[1].trim().to_string(); + } + } + } + FinalPackageStruct { + name: module::localinventory::data::software::common::clean_name(name.clone()), + originalname: name, + version: version.clone(), + revision: "".to_string(), + originalversion: version, + publisher: publisher, + maintainer: "".to_string(), + repository: "".to_string(), + pkgtype: "snap".to_string(), + architecture: "".to_string(), + category: "".to_string(), + installationdate: "".to_string(), + uninstallcommand: "".to_string(), + id: id, + comment: comment, + mainurl: mainurl, + helpurl: "".to_string(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_snap_extract_packagename() { + let data: String = std::fs::read_to_string("tests/localinventory/data/software/snaplist.dat").unwrap(); + let result: Vec = parse_snap_extract_packagename(data); + let mut expected: Vec = Vec::new(); + expected.push("bare".to_string()); + expected.push("core18".to_string()); + expected.push("gnome-3-28-1804".to_string()); + expected.push("gtk-common-themes".to_string()); + expected.push("losslesscut".to_string()); + expected.push("snapd".to_string()); + + assert_eq!(result, expected); + } + + #[test] + fn test_parse_snap_package() { + let data: String = std::fs::read_to_string("tests/localinventory/data/software/snap_losslesscut.dat").unwrap(); + let result: FinalPackageStruct = parse_snap_package(data); + let expected: FinalPackageStruct = serde_json::from_value(serde_json::json!({ + "name": "losslesscut".to_string(), + "originalname": "losslesscut".to_string(), + "version": "3.60.0".to_string(), + "revision": "".to_string(), + "originalversion": "3.60.0".to_string(), + "publisher": "Mikael Finstad (mifino)".to_string(), + "maintainer": "".to_string(), + "repository": "".to_string(), + "pkgtype": "snap".to_string(), + "architecture": "".to_string(), + "category": "".to_string(), + "installationdate": "".to_string(), + "uninstallcommand": "".to_string(), + "id": "uRYH61YLB0C3jpYE5sUqf3Tr3KSfuILe".to_string(), + "comment": "The swiss army knife of lossless video/audio editing".to_string(), + "mainurl": "https://snapcraft.io/losslesscut".to_string(), + "helpurl": "".to_string(), + })).unwrap(); + + assert_eq!(result, expected); + } + + #[test] + fn test_parse_snap_package_gnome() { + let data: String = std::fs::read_to_string("tests/localinventory/data/software/snap_gnome-3-28-1804.dat").unwrap(); + let result: FinalPackageStruct = parse_snap_package(data); + let expected: FinalPackageStruct = serde_json::from_value(serde_json::json!({ + "name": "gnome".to_string(), + "originalname": "gnome-3-28-1804".to_string(), + "version": "3.28.0-19-g98f9e67.98f9e67".to_string(), + "revision": "".to_string(), + "originalversion": "3.28.0-19-g98f9e67.98f9e67".to_string(), + "publisher": "Canonical**".to_string(), + "maintainer": "".to_string(), + "repository": "".to_string(), + "pkgtype": "snap".to_string(), + "architecture": "".to_string(), + "category": "".to_string(), + "installationdate": "".to_string(), + "uninstallcommand": "".to_string(), + "id": "TKv5Fm000l4XiUYJW9pjWHLkCPlDbIg1".to_string(), + "comment": "Shared GNOME 3.28 runtime for Ubuntu 18.04".to_string(), + "mainurl": "https://snapcraft.io/gnome-3-28-1804".to_string(), + "helpurl": "".to_string(), + })).unwrap(); + + assert_eq!(result, expected); + } + +} diff --git a/src/module/localinventory/data/software/mod.rs b/src/module/localinventory/data/software/mod.rs index 709a7bc..602fe43 100644 --- a/src/module/localinventory/data/software/mod.rs +++ b/src/module/localinventory/data/software/mod.rs @@ -12,3 +12,5 @@ pub mod freebsd; pub mod linux; +pub mod windows; +pub mod common; diff --git a/src/module/localinventory/data/software/windows/mod.rs b/src/module/localinventory/data/software/windows/mod.rs new file mode 100644 index 0000000..f3c7f4b --- /dev/null +++ b/src/module/localinventory/data/software/windows/mod.rs @@ -0,0 +1,13 @@ +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +pub mod registry; diff --git a/src/module/localinventory/data/software/windows/registry.rs b/src/module/localinventory/data/software/windows/registry.rs new file mode 100644 index 0000000..b1c7bf9 --- /dev/null +++ b/src/module/localinventory/data/software/windows/registry.rs @@ -0,0 +1,41 @@ +#![cfg(target_os = "windows")] +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + + + +use crate::module; +use module::localinventory::structure::software::FinalPackageStruct; +use winreg::enums::*; +use winreg::RegKey; + +pub fn run_inventory() -> Vec { + // let output_snap = get_snap_list(); + let data: Vec = Vec::new(); + return data; +} + +fn get_registry_softwares() { + + let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); + let cur_path = hklm.open_subkey("SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall"); + + // path => 'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall', + // wmiopts => { # Only used for remote WMI optimization + // values => [ qw/ + // DisplayName Comments HelpLink ReleaseType DisplayVersion + // Publisher URLInfoAbout UninstallString InstallDate MinorVersion + // MajorVersion NoRemove SystemComponent + // / ] + // }, + +} diff --git a/src/module/localinventory/data/volume/freebsd.rs b/src/module/localinventory/data/volume/freebsd.rs index b5ff5b9..4881938 100644 --- a/src/module/localinventory/data/volume/freebsd.rs +++ b/src/module/localinventory/data/volume/freebsd.rs @@ -158,7 +158,7 @@ fn zfs_pools() -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; // parsing the command output to extract information needed @@ -213,7 +213,7 @@ fn zfs_datasets(volume: String) -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; let mut datasets: Vec> = Vec::new(); diff --git a/src/module/localinventory/data/volume/linux.rs b/src/module/localinventory/data/volume/linux.rs index 5093214..fe162aa 100644 --- a/src/module/localinventory/data/volume/linux.rs +++ b/src/module/localinventory/data/volume/linux.rs @@ -34,7 +34,7 @@ fn get_vgs() -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; // parsing the command output to extract information needed @@ -73,7 +73,7 @@ fn get_lvs(volume_group: String) -> Vec> { let empty = String::from(""); let data = match String::from_utf8(output.stdout) { Ok(x) => x, - Err(e) => empty, + Err(_) => empty, }; let mut logical_volumes: Vec> = Vec::new(); diff --git a/src/module/localinventory/run_servers.rs b/src/module/localinventory/run_servers.rs index 5c57162..59d3fec 100644 --- a/src/module/localinventory/run_servers.rs +++ b/src/module/localinventory/run_servers.rs @@ -46,7 +46,7 @@ fn run_http(server: String) { let client = reqwest::blocking::Client::new(); - let mut res = match client.post(server) + match client.post(server) .header(USER_AGENT, USER_AGENT_VALUE) .json(&inventory) .send() { @@ -57,7 +57,6 @@ fn run_http(server: String) { Err(c) => println!("ERROR: {}", c), }; - // let client = reqwest::Client::new(); // let res = client.post(server) // .header(USER_AGENT, USER_AGENT_VALUE) diff --git a/src/module/localinventory/structure/chassis.rs b/src/module/localinventory/structure/chassis.rs index 7cb7701..7fedda4 100644 --- a/src/module/localinventory/structure/chassis.rs +++ b/src/module/localinventory/structure/chassis.rs @@ -68,7 +68,9 @@ pub fn run_inventory() -> serde_json::Value { // Get CPUs let cpus = module::localinventory::structure::cpu::run_inventory(); - children.push(cpus); + for cpu in cpus { + children.push(cpu); + } // Get disks let disks = module::localinventory::structure::physicaldisk::run_inventory(); diff --git a/src/module/localinventory/structure/cpu.rs b/src/module/localinventory/structure/cpu.rs index f0db042..6d1e48f 100644 --- a/src/module/localinventory/structure/cpu.rs +++ b/src/module/localinventory/structure/cpu.rs @@ -11,18 +11,118 @@ // License along with this program. If not, see . use crate::module; +use serde::{Deserialize, Serialize}; -pub fn run_inventory() -> serde_json::Value { +#[derive(Debug, Deserialize, Serialize)] +#[derive(PartialEq)] +pub struct FinalProcessorStruct { + pub(crate) manufacturer: String, + pub(crate) id: String, + pub(crate) family: String, + pub(crate) speed: i32, + pub(crate) speed_unit: String, + pub(crate) serialnumber: String, + pub(crate) corecount: i32, + pub(crate) threadcount: i32, + pub(crate) flags: Vec, + pub(crate) characteristics: Vec, + pub(crate) l1cache: i32, + pub(crate) l1cache_unit: String, + pub(crate) l2cache: i32, + pub(crate) l2cache_unit: String, + pub(crate) l3cache: i32, + pub(crate) l3cache_unit: String, +} + +pub fn run_inventory() -> Vec { log::info!("Get Chassis information"); - let properties = module::localinventory::data::cpu::dmidecode::run_inventory(); + let mut cpus = Vec::new(); + + let output: Vec = module::localinventory::data::cpu::dmidecode::run_inventory(); + let cpuproperties = fill_properties(output); + + for properties in cpuproperties { + let cpu = serde_json::json!({ + "type": "cpu", + "properties": properties, + "children": [], + "connectedto": [] + }); + + cpus.push(cpu); + } + return cpus; +} + +fn fill_properties(cpudata: Vec) -> Vec { + let mut cpus = Vec::new(); - let cpu = serde_json::json!({ - "type": "CPU", - "properties": properties, - "children": [], - "connectedto": [] - }); + for package in cpudata { + let data = serde_json::json!([ + { + "key": "manufacturer", + "value": package.manufacturer + }, + { + "key": "id", + "value": package.id + }, + { + "key": "family", + "value": package.family + }, + { + "key": "speed", + "type": "integer", + "unit": package.speed_unit, + "value": package.speed + }, + { + "key": "serialnumber", + "value": package.serialnumber + }, + { + "key": "corecount", + "type": "integer", + "value": package.corecount + }, + { + "key": "threadcount", + "type": "integer", + "value": package.threadcount + }, + { + "key": "flags", + "type": "list", + "value": package.flags + }, + { + "key": "characteristics", + "type": "list", + "value": package.characteristics + }, + { + "key": "L1 cache", + "type": "integer", + "unit": package.l1cache_unit, + "value": package.l1cache + }, + { + "key": "L2 cache", + "type": "integer", + "unit": package.l2cache_unit, + "value": package.l2cache + }, + { + "key": "L2 cache", + "type": "integer", + "unit": package.l3cache_unit, + "value": package.l3cache + } + ]); + cpus.push(data); + } + return cpus; - return cpu; } diff --git a/src/module/localinventory/structure/filesystem.rs b/src/module/localinventory/structure/filesystem.rs index a09dcab..5bb54c1 100644 --- a/src/module/localinventory/structure/filesystem.rs +++ b/src/module/localinventory/structure/filesystem.rs @@ -81,3 +81,11 @@ fn get_data_novolume() -> Vec { let data = Vec::new(); return data; } + +#[cfg(target_os = "macos")] +fn get_data_novolume() -> Vec { + // TODO + let data = Vec::new(); + return data; +} + diff --git a/src/module/localinventory/structure/operatingsystem.rs b/src/module/localinventory/structure/operatingsystem.rs index 4143730..c3771c7 100644 --- a/src/module/localinventory/structure/operatingsystem.rs +++ b/src/module/localinventory/structure/operatingsystem.rs @@ -50,8 +50,13 @@ fn get_data() -> serde_json::Value { } #[cfg(target_os = "windows")] -fn get_data() { - +fn get_data() -> serde_json::Value { + return serde_json::json!([]); +} + +#[cfg(target_os = "macos")] +fn get_data() -> serde_json::Value { + return serde_json::json!([]); } // "windows" diff --git a/src/module/localinventory/structure/partition.rs b/src/module/localinventory/structure/partition.rs index 61f8a58..14a68e9 100644 --- a/src/module/localinventory/structure/partition.rs +++ b/src/module/localinventory/structure/partition.rs @@ -47,6 +47,13 @@ fn get_data(disk: serde_json::Value) -> Vec { return data; } +#[cfg(target_os = "macos")] +fn get_data(disk: serde_json::Value) -> Vec { + // module::localinventory::data::partition::windows::run_inventory(disk) + let data = Vec::new(); + return data; +} + // "windows" // "macos" // "ios" diff --git a/src/module/localinventory/structure/physicaldisk.rs b/src/module/localinventory/structure/physicaldisk.rs index 1bfb40a..9cec9fa 100644 --- a/src/module/localinventory/structure/physicaldisk.rs +++ b/src/module/localinventory/structure/physicaldisk.rs @@ -57,6 +57,13 @@ fn get_data() -> Vec { return data; } +#[cfg(target_os = "macos")] +fn get_data() -> Vec { + // TODO + let data = Vec::new(); + return data; +} + // "windows" // "macos" // "ios" diff --git a/src/module/localinventory/structure/software.rs b/src/module/localinventory/structure/software.rs index 2a765b4..fbd4e19 100644 --- a/src/module/localinventory/structure/software.rs +++ b/src/module/localinventory/structure/software.rs @@ -11,13 +11,39 @@ // License along with this program. If not, see . use crate::module; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Deserialize, Serialize)] +#[derive(PartialEq)] + +pub struct FinalPackageStruct { + pub(crate) name: String, + pub(crate) originalname: String, + pub(crate) version: String, + pub(crate) revision: String, + pub(crate) originalversion: String, + pub(crate) publisher: String, + pub(crate) maintainer: String, + pub(crate) repository: String, + pub(crate) pkgtype: String, + pub(crate) architecture: String, + pub(crate) category: String, + pub(crate) installationdate: String, + pub(crate) uninstallcommand: String, + pub(crate) id: String, + pub(crate) comment: String, + pub(crate) mainurl: String, + pub(crate) helpurl: String, +} + pub fn run_inventory() -> Vec { log::info!("Get softwares information"); let mut softwares = Vec::new(); - let softwareproperties = get_data(); + let data: Vec = get_data(); + let softwareproperties = fill_properties(data); for properties in softwareproperties { let software = serde_json::json!({ @@ -34,18 +60,125 @@ pub fn run_inventory() -> Vec { return softwares; } +fn fill_properties(packages: Vec) -> Vec { + let mut softwares = Vec::new(); + + for package in packages { + let data = serde_json::json!([ + { + "key": "name", + "value": package.name, + }, + { + "key": "originalname", + "value": package.originalname, + }, + { + "key": "version", + "value": package.version, + }, + { + "key": "revision", + "value": package.revision, + }, + { + "key": "originalversion", + "value": package.originalversion, + }, + { + "key": "publisher", + "value": package.publisher, + }, + { + "key": "maintainer", + "value": package.maintainer, + }, + { + "key": "repository", + "value": package.repository, + }, + { + "key": "type", + "value": package.pkgtype, // pkg, PRM, ... + }, + { + "key": "architecture", + "value": package.architecture, + }, + { + "key": "category", + "value": package.category + }, + { + "key": "installationdate", + "value": package.installationdate, + }, + { + "key": "uninstallcommand", + "value": package.uninstallcommand, + }, + { + "key": "id", + "value": package.id, + }, + { + "key": "comment", + "value": package.comment, + }, + { + "key": "mainurl", + "value": package.mainurl, + }, + { + "key": "helpurl", + "value": package.helpurl, + } + ]); + softwares.push(data); + } + return softwares; +} + #[cfg(target_os = "linux")] -fn get_data() -> Vec { - module::localinventory::data::software::linux::run_inventory() +fn get_data() -> Vec { + let mut softwares = Vec::new(); + + // https://github.com/sigoden/upt + + let mut data_rpm = module::localinventory::data::software::linux::rpm::run_inventory(); + softwares.append(&mut data_rpm); + + let mut data_dpkg = module::localinventory::data::software::linux::dpkg::run_inventory(); + softwares.append(&mut data_dpkg); + + let mut data_pacman = module::localinventory::data::software::linux::pacman::run_inventory(); + softwares.append(&mut data_pacman); + + let mut data_nix = module::localinventory::data::software::linux::nix::run_inventory(); + softwares.append(&mut data_nix); + + let mut data_snap = module::localinventory::data::software::linux::snap::run_inventory(); + softwares.append(&mut data_snap); + + return softwares; } #[cfg(target_os = "freebsd")] -fn get_data() -> Vec { +fn get_data() -> Vec { module::localinventory::data::software::freebsd::run_inventory() } #[cfg(target_os = "windows")] -fn get_data() -> Vec { +fn get_data() -> Vec { + // TODO + module::localinventory::data::software::windows::registry::run_inventory(); + + let data = Vec::new(); + return data; +} + +#[cfg(target_os = "macos")] +fn get_data() -> Vec { // TODO let data = Vec::new(); return data; diff --git a/src/module/localinventory/structure/volume.rs b/src/module/localinventory/structure/volume.rs index 1b02eba..fd81e87 100644 --- a/src/module/localinventory/structure/volume.rs +++ b/src/module/localinventory/structure/volume.rs @@ -113,6 +113,13 @@ fn get_data() -> Vec { return data; } +#[cfg(target_os = "macos")] +fn get_data() -> Vec { + // module::localinventory::data::partition::windows::run_inventory(disk) + let data = Vec::new(); + return data; +} + // "windows" // "macos" // "ios" diff --git a/tests/geom_t3600 b/tests/geom_t3600 new file mode 100644 index 0000000..3a061b2 --- /dev/null +++ b/tests/geom_t3600 @@ -0,0 +1,2045 @@ +kern.geom.confxml: + + FD + + + RAID + + + SWAP + + + PART + + + diskid/DISK-1310070000003578s2 + 4 + + BSD + 8 + 0 + 2589967 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-1310070000003578s2a + 1326055424 + 512 + 0 + 34099712 + + 16 + 2589967 + 1 + freebsd-ufs + 8192 + 1326055424 + 7 + + + + + + diskid/DISK-1310070000003578 + 3 + + MBR + 4 + 1 + 15669247 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-1310070000003578s2 + 1326063616 + 512 + 0 + 34091520 + + 66585 + 2656552 + 2 + freebsd + 34091520 + 1326063616 + 165 + active + HD(2,MBR,0x90909090,0x10419,0x278510) + + + + + r0w0e0 + diskid/DISK-1310070000003578s1 + 34091008 + 512 + 0 + 512 + + 1 + 66584 + 1 + efi + 512 + 34091008 + 239 + HD(1,MBR,0x90909090,0x1,0x10418) + + + + + + da2s2 + 3 + + BSD + 8 + 0 + 2589967 + 63 + 255 + OK + false + + + + + r1w0e1 + + + + + + r1w0e1 + da2s2a + 1326055424 + 512 + 0 + 34099712 + + 16 + 2589967 + 1 + freebsd-ufs + 8192 + 1326055424 + 7 + + + + + + da2 + 2 + + MBR + 4 + 1 + 15669247 + 63 + 255 + OK + false + + + + + r1w0e1 + + + + + + r1w0e1 + da2s2 + 1326063616 + 512 + 0 + 34091520 + + 66585 + 2656552 + 2 + freebsd + 34091520 + 1326063616 + 165 + active + HD(2,MBR,0x90909090,0x10419,0x278510) + + + + + r0w0e0 + da2s1 + 34091008 + 512 + 0 + 512 + + 1 + 66584 + 1 + efi + 512 + 34091008 + 239 + HD(1,MBR,0x90909090,0x1,0x10418) + + + + + + diskid/DISK-WD-WXR1A3090652 + 3 + + GPT + 128 + 34 + 1250263694 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-WD-WXR1A3090652p2 + 1073741824 + 512 + 0 + 2097152 + + 4096 + 2101247 + 2 + linux-data + 2097152 + 1073741824 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + e3373bb5-2342-4065-907e-3ca08252c693 + HD(2,GPT,e3373bb5-2342-4065-907e-3ca08252c693,0x1000,0x200000) + + + + + r0w0e0 + diskid/DISK-WD-WXR1A3090652p1 + 1048576 + 512 + 0 + 1048576 + + 2048 + 4095 + 1 + bios-boot + 1048576 + 1048576 + + 21686148-6449-6e6f-744e-656564454649 + 9be2a2f7-5580-4d4c-9169-95766fdbcefd + HD(1,GPT,9be2a2f7-5580-4d4c-9169-95766fdbcefd,0x800,0x800) + + + + + + da0 + 2 + + GPT + 128 + 34 + 1250263694 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + da0p2 + 1073741824 + 512 + 0 + 2097152 + + 4096 + 2101247 + 2 + linux-data + 2097152 + 1073741824 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + e3373bb5-2342-4065-907e-3ca08252c693 + HD(2,GPT,e3373bb5-2342-4065-907e-3ca08252c693,0x1000,0x200000) + + + + + r0w0e0 + da0p1 + 1048576 + 512 + 0 + 1048576 + + 2048 + 4095 + 1 + bios-boot + 1048576 + 1048576 + + 21686148-6449-6e6f-744e-656564454649 + 9be2a2f7-5580-4d4c-9169-95766fdbcefd + HD(1,GPT,9be2a2f7-5580-4d4c-9169-95766fdbcefd,0x800,0x800) + + + + + + diskid/DISK-BF330798065300030193 + 3 + + MBR + 4 + 63 + 234441647 + 63 + 16 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-BF330798065300030193s2 + 119424417792 + 512 + 0 + 608174080 + + 1187840 + 234438655 + 2 + ntfs + 608174080 + 119424417792 + 7 + HD(2,MBR,0xdbe2d1a8,0x122000,0xde72000) + + + + + r0w0e0 + diskid/DISK-BF330798065300030193s1 + 607125504 + 512 + 0 + 1048576 + + 2048 + 1187839 + 1 + ntfs + 1048576 + 607125504 + 7 + active + HD(1,MBR,0xdbe2d1a8,0x800,0x121800) + + + + + + diskid/DISK-E15C079B0C9000502136 + 3 + + MBR + 4 + 63 + 468862127 + 63 + 16 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-E15C079B0C9000502136s2 + 238982004736 + 512 + 0 + 1074790400 + + 2099200 + 468860927 + 2 + linux-data + 1074790400 + 238982004736 + 131 + HD(2,MBR,0x490e5cef,0x200800,0x1bd23800) + + + + + r0w0e0 + diskid/DISK-E15C079B0C9000502136s1 + 1073741824 + 512 + 0 + 1048576 + + 2048 + 2099199 + 1 + linux-data + 1048576 + 1073741824 + 131 + active + HD(1,MBR,0x490e5cef,0x800,0x200000) + + + + + + diskid/DISK-205252800394 + 3 + + MBR + 4 + 63 + 976773167 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-205252800394s1 + 500104691712 + 512 + 0 + 1048576 + + 2048 + 976769023 + 1 + ntfs + 1048576 + 500104691712 + 7 + HD(1,MBR,0x993e7834,0x800,0x3a384800) + + + + + + ada0 + 2 + + MBR + 4 + 63 + 234441647 + 63 + 16 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + ada0s2 + 119424417792 + 512 + 0 + 608174080 + + 1187840 + 234438655 + 2 + ntfs + 608174080 + 119424417792 + 7 + HD(2,MBR,0xdbe2d1a8,0x122000,0xde72000) + + + + + r0w0e0 + ada0s1 + 607125504 + 512 + 0 + 1048576 + + 2048 + 1187839 + 1 + ntfs + 1048576 + 607125504 + 7 + active + HD(1,MBR,0xdbe2d1a8,0x800,0x121800) + + + + + + ada1 + 2 + + MBR + 4 + 63 + 468862127 + 63 + 16 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + ada1s2 + 238982004736 + 512 + 0 + 1074790400 + + 2099200 + 468860927 + 2 + linux-data + 1074790400 + 238982004736 + 131 + HD(2,MBR,0x490e5cef,0x200800,0x1bd23800) + + + + + r0w0e0 + ada1s1 + 1073741824 + 512 + 0 + 1048576 + + 2048 + 2099199 + 1 + linux-data + 1048576 + 1073741824 + 131 + active + HD(1,MBR,0x490e5cef,0x800,0x200000) + + + + + + nda1 + 2 + + MBR + 4 + 63 + 976773167 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + nda1s1 + nvd1s1 + 500104691712 + 512 + 0 + 1048576 + + 2048 + 976769023 + 1 + ntfs + 1048576 + 500104691712 + 7 + HD(1,MBR,0x993e7834,0x800,0x3a384800) + + + + + + diskid/DISK-2339E879323C + 3 + + GPT + 128 + 34 + 3907029134 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-2339E879323Cp3 + 75161927680 + 512 + 0 + 1924163174400 + + 3758131200 + 3904931839 + 3 + linux-data + 1924163174400 + 75161927680 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + 5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3 + HD(3,GPT,5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3,0xe0008800,0x8c00000) + + + + + r0w0e0 + diskid/DISK-2339E879323Cp2 + 1924161077248 + 512 + 0 + 2097152 + + 4096 + 3758131199 + 2 + linux-data + 2097152 + 1924161077248 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + c56f3242-dfa1-435c-939d-b217bba07e6a + HD(2,GPT,c56f3242-dfa1-435c-939d-b217bba07e6a,0x1000,0xe0007800) + + + + + r0w0e0 + diskid/DISK-2339E879323Cp1 + 1048576 + 512 + 0 + 1048576 + + 2048 + 4095 + 1 + bios-boot + 1048576 + 1048576 + + 21686148-6449-6e6f-744e-656564454649 + 55133079-e82a-41e1-a31c-105965a61fca + HD(1,GPT,55133079-e82a-41e1-a31c-105965a61fca,0x800,0x800) + + + + + + nda0 + 2 + + GPT + 128 + 34 + 3907029134 + 63 + 255 + OK + false + + + + + r0w0e0 + + + + + + r0w0e0 + nda0p3 + nvd0p3 + 75161927680 + 512 + 0 + 1924163174400 + + 3758131200 + 3904931839 + 3 + linux-data + 1924163174400 + 75161927680 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + 5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3 + HD(3,GPT,5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3,0xe0008800,0x8c00000) + + + + + r0w0e0 + nda0p2 + nvd0p2 + 1924161077248 + 512 + 0 + 2097152 + + 4096 + 3758131199 + 2 + linux-data + 2097152 + 1924161077248 + + 0fc63daf-8483-4772-8e79-3d69d8477de4 + c56f3242-dfa1-435c-939d-b217bba07e6a + HD(2,GPT,c56f3242-dfa1-435c-939d-b217bba07e6a,0x1000,0xe0007800) + + + + + r0w0e0 + nda0p1 + nvd0p1 + 1048576 + 512 + 0 + 1048576 + + 2048 + 4095 + 1 + bios-boot + 1048576 + 1048576 + + 21686148-6449-6e6f-744e-656564454649 + 55133079-e82a-41e1-a31c-105965a61fca + HD(1,GPT,55133079-e82a-41e1-a31c-105965a61fca,0x800,0x800) + + + + + + LABEL + + + diskid/DISK-1310070000003578s2a + 5 + + + + + + r0w0e0 + + + + + + r0w0e0 + ufsid/654df9ff54c010f3 + 1326055424 + 512 + 0 + 34099712 + + 0 + 1326055424 + 2589952 + 0 + 0 + + + + + + da2 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-1310070000003578 + 8022654976 + 512 + 0 + 0 + + 0 + 8022654976 + 15669248 + 0 + 0 + + + + + + da2s2a + 4 + + + + + + r1w0e1 + + + + + + r1w0e0 + ufs/FreeBSD_Install + 1326055424 + 512 + 0 + 34099712 + + 0 + 1326055424 + 2589952 + 0 + 0 + + + + + + da2s1 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + msdosfs/EFISYS + 34091008 + 512 + 0 + 512 + + 0 + 34091008 + 66584 + 0 + 0 + + + + + + da0p2 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + gptid/e3373bb5-2342-4065-907e-3ca08252c693 + 1073741824 + 512 + 0 + 2097152 + + 0 + 1073741824 + 2097152 + 0 + 0 + + + + + + da0p1 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + gptid/9be2a2f7-5580-4d4c-9169-95766fdbcefd + 1048576 + 512 + 0 + 1048576 + + 0 + 1048576 + 2048 + 0 + 0 + + + + + + da0 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-WD-WXR1A3090652 + 640135028736 + 512 + 0 + 0 + + 0 + 640135028736 + 1250263728 + 0 + 0 + + + + + + ada0s1 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + ntfs/System%20Reserved + 607125504 + 512 + 0 + 1048576 + + 0 + 607125504 + 1185792 + 0 + 0 + + + + + + nda1s1 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + ntfs/Games + 500104691712 + 512 + 0 + 1048576 + + 0 + 500104691712 + 976766976 + 0 + 0 + + + + + + ada0 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-BF330798065300030193 + 120034123776 + 512 + 0 + 0 + + 0 + 120034123776 + 234441648 + 0 + 0 + + + + + + ada1 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-E15C079B0C9000502136 + 240057409536 + 512 + 0 + 0 + + 0 + 240057409536 + 468862128 + 0 + 0 + + + + + + nda1 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-205252800394 + 500107862016 + 512 + 0 + 0 + + 0 + 500107862016 + 976773168 + 0 + 0 + + + + + + nda0p3 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + gptid/5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3 + 75161927680 + 512 + 0 + 1924163174400 + + 0 + 75161927680 + 146800640 + 0 + 0 + + + + + + nda0p2 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + gptid/c56f3242-dfa1-435c-939d-b217bba07e6a + 1924161077248 + 512 + 0 + 2097152 + + 0 + 1924161077248 + 3758127104 + 0 + 0 + + + + + + nda0p1 + 3 + + + + + + r0w0e0 + + + + + + r0w0e0 + gptid/55133079-e82a-41e1-a31c-105965a61fca + 1048576 + 512 + 0 + 1048576 + + 0 + 1048576 + 2048 + 0 + 0 + + + + + + nda0 + 2 + + + + + + r0w0e0 + + + + + + r0w0e0 + diskid/DISK-2339E879323C + 2000398934016 + 512 + 0 + 0 + + 0 + 2000398934016 + 3907029168 + 0 + 0 + + + + + + VFS + + + ffs.ufs/FreeBSD_Install + 5 + + + + r1w0e0 + + + + + Flashmap + + + DISK + + + da2 + 1 + + + + + r1w0e1 + da2 + 8022654976 + 512 + 0 + 0 + + 255 + 63 + unknown + 1310070000003578 + 2020030102060804 + USB MEMORY BAR + General USB Flash Disk + + + + + + da1 + 1 + + + + + r0w0e0 + da1 + 0 + 512 + 0 + 0 + + 0 + 0 + unknown + 121220160204 + Mass Storage Device + + + + + + da0 + 1 + + + + + r0w0e0 + da0 + 640135028736 + 512 + 0 + 0 + + 255 + 63 + 5400 + WD-WXR1A3090652 + 50014ee6aac6a475 + ATA WDC WD6400BEVT-60A0RT0 WD-WXR1A3090652 + ATA WDC WD6400BEVT-6 + + + + + + ada0 + 1 + + + + + r0w0e0 + ada0 + 120034123776 + 512 + 0 + 0 + + 16 + 63 + 0 + BF330798065300030193 + SATA SSD + + + + + + cd0 + 1 + + + + + r0w0e0 + cd0 + 0 + 2048 + 0 + 0 + + 0 + 0 + unknown + + PLDS DVD-ROM DS-8D3SH + + + + + + ada1 + 1 + + + + + r0w0e0 + ada1 + 240057409536 + 512 + 0 + 0 + + 16 + 63 + 0 + E15C079B0C9000502136 + SATA SSD + + + + + + nda1 + 1 + + + + + r0w0e0 + nda1 + nvd1 + 500107862016 + 512 + 0 + 0 + + 0 + 0 + 0 + 205252800394 + e8238fa6bf530001001b448b48670125 + WDS500G3XHC-00SJG0 + + + + + + nda0 + 1 + + + + + r0w0e0 + nda0 + nvd0 + 2000398934016 + 512 + 0 + 0 + + 0 + 0 + 0 + 2339E879323C + 6479a782e0000004 + CT2000P3PSSD8 + + + + + + DEV + + + ufsid/654df9ff54c010f3 + 6 + + + + r0w0e0 + + + + + diskid/DISK-1310070000003578s2a + 5 + + + + r0w0e0 + + + + + diskid/DISK-1310070000003578s2 + 4 + + + + r0w0e0 + + + + + diskid/DISK-1310070000003578s1 + 4 + + + + r0w0e0 + + + + + diskid/DISK-1310070000003578 + 3 + + + + r0w0e0 + + + + + ufs/FreeBSD_Install + 5 + + + + r0w0e0 + + + + + da2s2a + 4 + + + + r0w0e0 + + + + + msdosfs/EFISYS + 4 + + + + r0w0e0 + + + + + da2s2 + 3 + + + + r0w0e0 + + + + + da2s1 + 3 + + + + r0w0e0 + + + + + da2 + 2 + + + + r0w0e0 + + + + + da1 + 2 + + + + r0w0e0 + + + + + diskid/DISK-WD-WXR1A3090652p2 + 4 + + + + r0w0e0 + + + + + diskid/DISK-WD-WXR1A3090652p1 + 4 + + + + r0w0e0 + + + + + gptid/e3373bb5-2342-4065-907e-3ca08252c693 + 4 + + + + r0w0e0 + + + + + gptid/9be2a2f7-5580-4d4c-9169-95766fdbcefd + 4 + + + + r0w0e0 + + + + + diskid/DISK-WD-WXR1A3090652 + 3 + + + + r0w0e0 + + + + + da0p2 + 3 + + + + r0w0e0 + + + + + da0p1 + 3 + + + + r0w0e0 + + + + + diskid/DISK-BF330798065300030193s2 + 4 + + + + r0w0e0 + + + + + diskid/DISK-BF330798065300030193s1 + 4 + + + + r0w0e0 + + + + + ntfs/System%20Reserved + 4 + + + + r0w0e0 + + + + + diskid/DISK-E15C079B0C9000502136s2 + 4 + + + + r0w0e0 + + + + + diskid/DISK-E15C079B0C9000502136s1 + 4 + + + + r0w0e0 + + + + + diskid/DISK-205252800394s1 + 4 + + + + r0w0e0 + + + + + ntfs/Games + 4 + + + + r0w0e0 + + + + + da0 + 2 + + + + r0w0e0 + + + + + diskid/DISK-BF330798065300030193 + 3 + + + + r0w0e0 + + + + + ada0s2 + 3 + + + + r0w0e0 + + + + + ada0s1 + 3 + + + + r0w0e0 + + + + + diskid/DISK-E15C079B0C9000502136 + 3 + + + + r0w0e0 + + + + + ada1s2 + 3 + + + + r0w0e0 + + + + + ada1s1 + 3 + + + + r0w0e0 + + + + + diskid/DISK-205252800394 + 3 + + + + r0w0e0 + + + + + nda1s1 + 3 + + + + r0w0e0 + + + + + diskid/DISK-2339E879323Cp3 + 4 + + + + r0w0e0 + + + + + diskid/DISK-2339E879323Cp2 + 4 + + + + r0w0e0 + + + + + diskid/DISK-2339E879323Cp1 + 4 + + + + r0w0e0 + + + + + gptid/5a50e0d9-a64f-4578-9e7d-8cc1db74c6a3 + 4 + + + + r0w0e0 + + + + + gptid/c56f3242-dfa1-435c-939d-b217bba07e6a + 4 + + + + r0w0e0 + + + + + gptid/55133079-e82a-41e1-a31c-105965a61fca + 4 + + + + r0w0e0 + + + + + ada0 + 2 + + + + r0w0e0 + + + + + cd0 + 2 + + + + r0w0e0 + + + + + ada1 + 2 + + + + r0w0e0 + + + + + nda1 + 2 + + + + r0w0e0 + + + + + diskid/DISK-2339E879323C + 3 + + + + r0w0e0 + + + + + nda0p3 + 3 + + + + r0w0e0 + + + + + nda0p2 + 3 + + + + r0w0e0 + + + + + nda0p1 + 3 + + + + r0w0e0 + + + + + nda0 + 2 + + + + r0w0e0 + + + + + MD + + + diff --git a/tests/localinventory/data/cpu/SFSVBE03.dat b/tests/localinventory/data/cpu/SFSVBE03.dat new file mode 100644 index 0000000..f659bfc --- /dev/null +++ b/tests/localinventory/data/cpu/SFSVBE03.dat @@ -0,0 +1,1029 @@ +Processor Information + Socket Designation: CPU 0 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: 3139 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU 1 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: 3139 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU 2 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 3 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 4 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 5 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 6 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 7 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 8 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 9 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 10 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 11 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 12 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 13 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 14 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 15 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 16 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 17 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 18 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 19 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 20 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 21 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 22 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 23 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 24 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 25 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 26 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 27 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 28 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 29 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 30 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 31 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 32 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 33 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 34 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 35 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 36 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 37 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 38 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 39 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 40 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 41 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 42 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 43 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 44 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 45 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 46 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 47 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 48 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 49 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 50 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 51 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 52 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 53 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 54 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 55 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 56 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 57 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 58 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + +Processor Information + Socket Designation: CPU 59 + Type: Central Processor + Family: Unknown + Manufacturer: Not Specified + Version: Unknown Processor + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 3139 MHz + Current Speed: Unknown + Status: Unpopulated + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Characteristics: None + + diff --git a/tests/localinventory/data/cpu/SKAVBE01.dat b/tests/localinventory/data/cpu/SKAVBE01.dat new file mode 100644 index 0000000..13dbc75 --- /dev/null +++ b/tests/localinventory/data/cpu/SKAVBE01.dat @@ -0,0 +1,441 @@ +Processor Information + Socket Designation: CPU #000 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #001 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #002 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #003 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #004 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #005 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #006 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Processor Information + Socket Designation: CPU #007 + Type: Central Processor + Family: Unknown + Manufacturer: GenuineIntel + Version: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz + Voltage: 3.3 V + External Clock: Unknown + Max Speed: 30000 MHz + Current Speed: 2600 MHz + Status: Populated, Enabled + Upgrade: ZIF Socket + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 1 + Core Enabled: 1 + Characteristics: + 64-bit capable + Execute Protection + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L1 + Configuration: Enabled, Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 kB + Maximum Size: 16 kB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Asynchronous + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + +Cache Information + Socket Designation: L2 + Configuration: Enabled, Socketed, Level 2 + Operational Mode: Write Back + Location: External + Installed Size: 0 kB + Maximum Size: 24 MB + Supported SRAM Types: + Burst + Pipeline Burst + Asynchronous + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Unknown + System Type: Unknown + Associativity: Unknown + + diff --git a/tests/localinventory/data/cpu/bi-cpu.dat b/tests/localinventory/data/cpu/bi-cpu.dat new file mode 100644 index 0000000..5b73a0e --- /dev/null +++ b/tests/localinventory/data/cpu/bi-cpu.dat @@ -0,0 +1,192 @@ +Processor Information + Socket Designation: Proc 1 + Type: Central Processor + Family: Xeon + Manufacturer: Intel + Signature: Type 0, Family 6, Model 44, Stepping 2 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + DS (Debug store) + ACPI (ACPI supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + SS (Self-snoop) + HTT (Multi-threading) + TM (Thermal monitor supported) + PBE (Pending break enabled) + Version: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz + Voltage: 1.4 V + External Clock: 133 MHz + Max Speed: 4800 MHz + Current Speed: 2267 MHz + Status: Populated, Enabled + Upgrade: Socket LGA1366 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 6 + Core Enabled: 6 + Thread Count: 12 + Characteristics: + 64-bit capable + +Processor Information + Socket Designation: Proc 2 + Type: Central Processor + Family: Xeon + Manufacturer: Intel + Signature: Type 0, Family 6, Model 44, Stepping 2 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + DS (Debug store) + ACPI (ACPI supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + SS (Self-snoop) + HTT (Multi-threading) + TM (Thermal monitor supported) + PBE (Pending break enabled) + Version: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz + Voltage: 1.4 V + External Clock: 133 MHz + Max Speed: 4800 MHz + Current Speed: 2267 MHz + Status: Populated, Idle + Upgrade: Socket LGA1366 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 6 + Core Enabled: 6 + Thread Count: 12 + Characteristics: + 64-bit capable + +Cache Information + Socket Designation: Processor 1 Internal L1 Cache + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 192 kB + Maximum Size: 192 kB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Data + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: Processor 2 Internal L1 Cache + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 192 kB + Maximum Size: 192 kB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Data + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: Processor 1 Internal L2 Cache + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 1536 kB + Maximum Size: 1536 kB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unknown + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: Processor 2 Internal L2 Cache + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 1536 kB + Maximum Size: 1536 kB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unknown + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: Processor 1 Internal L3 Cache + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 12 MB + Maximum Size: 12 MB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unknown + Associativity: 16-way Set-associative + +Cache Information + Socket Designation: Processor 2 Internal L3 Cache + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 12 MB + Maximum Size: 12 MB + Supported SRAM Types: + Burst + Installed SRAM Type: Burst + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unknown + Associativity: 16-way Set-associative + diff --git a/tests/localinventory/data/cpu/remi-srv.dat b/tests/localinventory/data/cpu/remi-srv.dat new file mode 100644 index 0000000..63d215f --- /dev/null +++ b/tests/localinventory/data/cpu/remi-srv.dat @@ -0,0 +1,100 @@ +Cache Information + Socket Designation: L1 Cache + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 256 kB + Maximum Size: 256 kB + Supported SRAM Types: + Synchronous + Installed SRAM Type: Synchronous + Speed: Unknown + Error Correction Type: Parity + System Type: Unified + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: L2 Cache + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 1 MB + Maximum Size: 1 MB + Supported SRAM Types: + Synchronous + Installed SRAM Type: Synchronous + Speed: Unknown + Error Correction Type: Single-bit ECC + System Type: Unified + Associativity: 4-way Set-associative + +Cache Information + Socket Designation: L3 Cache + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 8 MB + Maximum Size: 8 MB + Supported SRAM Types: + Synchronous + Installed SRAM Type: Synchronous + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Processor Information + Socket Designation: U3E1 + Type: Central Processor + Family: Xeon + Manufacturer: Intel(R) Corporation + Signature: Type 0, Family 6, Model 158, Stepping 9 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + DS (Debug store) + ACPI (ACPI supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + SS (Self-snoop) + HTT (Multi-threading) + TM (Thermal monitor supported) + PBE (Pending break enabled) + Version: Intel(R) Xeon(R) CPU E3-1220 v6 @ 3.00GHz + Voltage: 0.9 V + External Clock: 100 MHz + Max Speed: 8300 MHz + Current Speed: 3000 MHz + Status: Populated, Enabled + Upgrade: Other + Serial Number: To Be Filled By O.E.M. + Asset Tag: To Be Filled By O.E.M. + Part Number: To Be Filled By O.E.M. + Core Count: 4 + Core Enabled: 4 + Thread Count: 4 + Characteristics: + 64-bit capable + Multi-Core + Execute Protection + Enhanced Virtualization + Power/Performance Control + diff --git a/tests/localinventory/data/cpu/thinkpad_ddurieux.dat b/tests/localinventory/data/cpu/thinkpad_ddurieux.dat new file mode 100644 index 0000000..85f34ca --- /dev/null +++ b/tests/localinventory/data/cpu/thinkpad_ddurieux.dat @@ -0,0 +1,96 @@ +Cache Information + Socket Designation: L1 - Cache + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 384 kB + Maximum Size: 384 kB + Supported SRAM Types: + Pipeline Burst + Installed SRAM Type: Pipeline Burst + Speed: 1 ns + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: L2 - Cache + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 3 MB + Maximum Size: 3 MB + Supported SRAM Types: + Pipeline Burst + Installed SRAM Type: Pipeline Burst + Speed: 1 ns + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 8-way Set-associative + +Cache Information + Socket Designation: L3 - Cache + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 16 MB + Maximum Size: 16 MB + Supported SRAM Types: + Pipeline Burst + Installed SRAM Type: Pipeline Burst + Speed: 1 ns + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Processor Information + Socket Designation: FP6 + Type: Central Processor + Family: Zen + Manufacturer: Advanced Micro Devices, Inc. + Signature: Family 25, Model 80, Stepping 0 + Flags: + FPU (Floating-point unit on-chip) + VME (Virtual mode extension) + DE (Debugging extension) + PSE (Page size extension) + TSC (Time stamp counter) + MSR (Model specific registers) + PAE (Physical address extension) + MCE (Machine check exception) + CX8 (CMPXCHG8 instruction supported) + APIC (On-chip APIC hardware supported) + SEP (Fast system call) + MTRR (Memory type range registers) + PGE (Page global enable) + MCA (Machine check architecture) + CMOV (Conditional move instruction supported) + PAT (Page attribute table) + PSE-36 (36-bit page size extension) + CLFSH (CLFLUSH instruction supported) + MMX (MMX technology supported) + FXSR (FXSAVE and FXSTOR instructions supported) + SSE (Streaming SIMD extensions) + SSE2 (Streaming SIMD extensions 2) + HTT (Multi-threading) + Version: AMD Ryzen 5 PRO 7530U with Radeon Graphics + Voltage: 1.2 V + External Clock: 100 MHz + Max Speed: 4550 MHz + Current Speed: 2000 MHz + Status: Populated, Enabled + Upgrade: None + Serial Number: None + Asset Tag: None + Part Number: None + Core Count: 6 + Core Enabled: 6 + Thread Count: 12 + Characteristics: + 64-bit capable + Multi-Core + Hardware Thread + Execute Protection + Enhanced Virtualization + Power/Performance Control + diff --git a/tests/localinventory/data/filesystem/freebsd_mount.dat b/tests/localinventory/data/filesystem/freebsd_mount.dat new file mode 100644 index 0000000..72f534f --- /dev/null +++ b/tests/localinventory/data/filesystem/freebsd_mount.dat @@ -0,0 +1,51 @@ +zroot/ROOT/default on / (zfs, local, noatime, nfsv4acls, vnodes: count 3660 ) +devfs on /dev (devfs, vnodes: count 45 ) +/dev/gpt/efiboot0 on /boot/efi (msdosfs, local, writes: sync 1 async 0, reads: sync 10 async 0, vnodes: count 1 ) +zroot/home on /home (zfs, local, noatime, nfsv4acls, vnodes: count 282803 ) +zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls, vnodes: count 196 ) +zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls, vnodes: count 2 ) +zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls, vnodes: count 30 ) +zroot on /zroot (zfs, local, noatime, nfsv4acls, vnodes: count 2 ) +zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls, vnodes: count 3 ) +zroot/bastille on /usr/local/bastille (zfs, local, noatime, nfsv4acls, vnodes: count 7 ) +zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls, vnodes: count 1 ) +zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls, vnodes: count 2 ) +zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls, vnodes: count 1 ) +zroot/var/mail on /var/mail (zfs, local, nfsv4acls, vnodes: count 3 ) +zroot/bastille/cache on /usr/local/bastille/cache (zfs, local, noatime, nfsv4acls, vnodes: count 1 ) +zroot/bastille/logs on /var/log/bastille (zfs, local, noatime, nfsv4acls, vnodes: count 1 ) +zroot/datas on /datas (zfs, local, noatime, nfsv4acls, vnodes: count 314376 ) +zroot/bastille/backups on /usr/local/bastille/backups (zfs, local, noatime, nfsv4acls, vnodes: count 1 ) +zroot/bastille/releases on /usr/local/bastille/releases (zfs, local, noatime, nfsv4acls, vnodes: count 3 ) +zroot/bastille/templates on /usr/local/bastille/templates (zfs, local, noatime, nfsv4acls, vnodes: count 1 ) +zroot/bastille/jails on /usr/local/bastille/jails (zfs, local, noatime, nfsv4acls, vnodes: count 4 ) +zroot/bastille/releases/Debian12 on /usr/local/bastille/releases/Debian12 (zfs, local, noatime, nfsv4acls, vnodes: count 1 ) +zroot/bastille/jails/rust on /usr/local/bastille/jails/rust (zfs, local, noatime, nfsv4acls, vnodes: count 3 ) +zroot/bastille/jails/photoprism2 on /usr/local/bastille/jails/photoprism2 (zfs, local, noatime, nfsv4acls, vnodes: count 3 ) +zroot/bastille/jails/rust/root on /usr/local/bastille/jails/rust/root (zfs, local, noatime, nfsv4acls, vnodes: count 15 ) +zroot/bastille/jails/photoprism2/root on /usr/local/bastille/jails/photoprism2/root (zfs, local, noatime, nfsv4acls, vnodes: count 15 ) +linprocfs on /compat/linux/proc (linprocfs, local, vnodes: count 1 ) +linsysfs on /compat/linux/sys (linsysfs, local, vnodes: count 1 ) +devfs on /compat/linux/dev (devfs, vnodes: count 4 ) +fdescfs on /compat/linux/dev/fd (fdescfs, vnodes: count 2 ) +tmpfs on /compat/linux/dev/shm (tmpfs, local, vnodes: count 1 ) +devfs on /usr/local/bastille/jails/photoprism2/root/dev (devfs, vnodes: count 4 ) +tmpfs on /usr/local/bastille/jails/photoprism2/root/dev/shm (tmpfs, local, vnodes: count 1 ) +fdescfs on /usr/local/bastille/jails/photoprism2/root/dev/fd (fdescfs, vnodes: count 2 ) +linprocfs on /usr/local/bastille/jails/photoprism2/root/proc (linprocfs, local, vnodes: count 1 ) +linsysfs on /usr/local/bastille/jails/photoprism2/root/sys (linsysfs, local, vnodes: count 1 ) +/tmp on /usr/local/bastille/jails/photoprism2/root/tmp (nullfs, local, noatime, nosuid, nfsv4acls, vnodes: count 1 ) +devfs on /usr/local/bastille/jails/rust/root/dev (devfs, vnodes: count 4 ) +tmpfs on /usr/local/bastille/jails/rust/root/dev/shm (tmpfs, local, vnodes: count 1 ) +fdescfs on /usr/local/bastille/jails/rust/root/dev/fd (fdescfs, vnodes: count 2 ) +linprocfs on /usr/local/bastille/jails/rust/root/proc (linprocfs, local, vnodes: count 1 ) +linsysfs on /usr/local/bastille/jails/rust/root/sys (linsysfs, local, vnodes: count 1 ) +/tmp on /usr/local/bastille/jails/rust/root/tmp (nullfs, local, noatime, nosuid, nfsv4acls, vnodes: count 1 ) +devfs on /compat/debian/dev (devfs, vnodes: count 4 ) +tmpfs on /compat/debian/dev/shm (tmpfs, local, vnodes: count 1 ) +fdescfs on /compat/debian/dev/fd (fdescfs, vnodes: count 2 ) +linprocfs on /compat/debian/proc (linprocfs, local, vnodes: count 1 ) +linsysfs on /compat/debian/sys (linsysfs, local, vnodes: count 1 ) +/tmp on /compat/debian/tmp (nullfs, local, noatime, nosuid, nfsv4acls, vnodes: count 1 ) +/home on /compat/debian/home (nullfs, local, noatime, nfsv4acls, vnodes: count 1 ) +/datas/developpement/sources/FusionITSM/frontend on /compat/debian/data/frontend (nullfs, local, noatime, nfsv4acls, vnodes: count 1 ) diff --git a/tests/localinventory/data/software/fedora_rpm.dat b/tests/localinventory/data/software/fedora_rpm.dat new file mode 100644 index 0000000..36c6302 --- /dev/null +++ b/tests/localinventory/data/software/fedora_rpm.dat @@ -0,0 +1,3 @@ +libgcc x86_64 14.1.1 5.fc40 1718492707 Fedora Project GCC version 14 shared support library Unspecified Fedora Project http://gcc.gnu.org https://bugz.fedoraproject.org/gcc 499b0b8f20a953dfe935e85bd93a1cb2 +fonts-filesystem noarch 2.0.5 14.fc40 1718491972 Fedora Project Directories used by font packages Unspecified Fedora Project https://docs.fedoraproject.org/en-US/packaging-guidelines/FontsPolicy/ https://bugz.fedoraproject.org/fonts-rpm-macros 468b8f3f8c2d1e4c10f0c3f4f4e736c3 +xkeyboard-config noarch 2.41 1.fc40 1718491972 Fedora Project X Keyboard Extension configuration data Unspecified Fedora Project http://www.freedesktop.org/wiki/Software/XKeyboardConfig https://bugz.fedoraproject.org/xkeyboard-config 2935adee5a077f929fceb628bd4cb113 diff --git a/tests/localinventory/data/software/freebsd_pkg.dat b/tests/localinventory/data/software/freebsd_pkg.dat new file mode 100644 index 0000000..fb462e0 --- /dev/null +++ b/tests/localinventory/data/software/freebsd_pkg.dat @@ -0,0 +1,6 @@ +{"name":"Box2D","origin":"misc/box2d","version":"2.4.1","comment":"2D physics engine for games","maintainer":"yuri@FreeBSD.org","www":"https://box2d.org/","abi":"FreeBSD:14:amd64","arch":"freebsd:14:x86:64","prefix":"/usr/local","flatsize":433821,"timestamp":1709152837,"licenselogic":"single","licenses":["MIT"],"desc":"Box2D is a 2D physics engine for games.\n\nCollision:\n* Continuous collision detection\n* Contact callbacks: begin, end, pre-solve, post-solve\n* Convex polygons and circles\n* Multiple shapes per body\n* One-shot contact manifolds\n* Dynamic tree broadphase\n* Efficient pair management\n* Fast broadphase AABB queries\n* Collision groups and categories\n\nPhysics:\n* Continuous physics with time of impact solver\n* Persistent body-joint-contact graph\n* Island solution and sleep management\n* Contact, friction, and restitution\n* Stable stacking with a linear-time solver\n* Revolute, prismatic, distance, pulley, gear, mouse joint, other joint types\n* Joint limits, motors, and friction\n* Momentum decoupled position correction","categories":["misc"],"shlibs_provided":["libbox2d.so.2"],"annotations":{"FreeBSD_version":"1400097","repo_type":"binary","repository":"durieux_family_poudriere"},"files":{"/usr/local/include/box2d/b2_api.h":"1$17d82434dfe0dbea7a164ae4135c2ab3c23d808a441bfa6483bbe178db0e7499","/usr/local/include/box2d/b2_block_allocator.h":"1$f472e5b9136753adc812693aab97243b6e41b2413cd94126da969773504d5a4d","/usr/local/include/box2d/b2_body.h":"1$d8928d852de60cc69ae5edc8c306c825cb0ca46d71341010af7693b4e95ca245","/usr/local/include/box2d/b2_broad_phase.h":"1$df66b0bd5850a8d52994c5a24ddf36b5db6fc1b14f2acc6f947d8893cf648be7","/usr/local/include/box2d/b2_chain_shape.h":"1$4618edd26733e4d4a551413b3a509728f76fb6f7a248a34a2ca447172e593c9a","/usr/local/include/box2d/b2_circle_shape.h":"1$40dc35432ac45d7e6df41e70194153247d18079e05991179edba58babb7d1a0c","/usr/local/include/box2d/b2_collision.h":"1$edf6162b5f5fafdafa39edb91b24512270c7432b1a9f9fee743bb5724e8781e3","/usr/local/include/box2d/b2_common.h":"1$daffdec44be6006faa468d2c802fc60d1e085bf66e591d1723298b75345f3fac","/usr/local/include/box2d/b2_contact.h":"1$9b59dc4db129662d5f1582dd14a3d3b90d49cb442c6b67a0e09be646193dfd5f","/usr/local/include/box2d/b2_contact_manager.h":"1$81f2c035dc990e65587c2ce208164512cca4b1f2d935ad064f64e6e73b8282af","/usr/local/include/box2d/b2_distance.h":"1$0d26e09127a153deeac818208c909bcad01eccfa131d59e25b390551b31ebfe5","/usr/local/include/box2d/b2_distance_joint.h":"1$0f60006f0a9e2d755daeb00ee39889e0a6a343767c4d43abab0ee46caa16a8bc","/usr/local/include/box2d/b2_draw.h":"1$678799881785cc172491af928660e18536dc78902d494e4b1242c71843195311","/usr/local/include/box2d/b2_dynamic_tree.h":"1$3171222f6e64a2150b5a763a6ceb674f95d1bd85b0d8d8748e1c4f52b35f3c2f","/usr/local/include/box2d/b2_edge_shape.h":"1$0c0ec3ff5a0c9b6db63119447122c536f3dae7fde9c74a392ed95f26c81ae976","/usr/local/include/box2d/b2_fixture.h":"1$d14e79fcd139dd0ed407c0ea3475fe42096fdfa69f87bf30e8371392f09c1b40","/usr/local/include/box2d/b2_friction_joint.h":"1$1814f5dd2b7684461e337acb713f3f5bfae639cdbfc9e9f30de4f9f61fe0311b","/usr/local/include/box2d/b2_gear_joint.h":"1$faf218806a639957680673211e458f86a191723eaa4d8d33159c15b7efd80969","/usr/local/include/box2d/b2_growable_stack.h":"1$cd61d7e6c61c1f08ffef94ab73e988ad2be6e687e24b7113ebce960da784af8e","/usr/local/include/box2d/b2_joint.h":"1$23f57dd14373ea602f25bd2d9483f1e6f5cbf1cbe73c98817f6da8b3dc52d840","/usr/local/include/box2d/b2_math.h":"1$b040b76adcdd13a6f82781c4982691b197ad0a4290c4f87e4c99371dc593b63d","/usr/local/include/box2d/b2_motor_joint.h":"1$0630398b77d01a5fcb2a4b79ed536e844087394d23e46a0427d954cedf47fea5","/usr/local/include/box2d/b2_mouse_joint.h":"1$355e591dd4ae42f89b6fa81872d012cba9de99d0fc0030fc35e592013bf1f5cb","/usr/local/include/box2d/b2_polygon_shape.h":"1$38660d3304f975840c405f2f1dbd59cf8daceb1d53e98212aaaba61ebbbcbefb","/usr/local/include/box2d/b2_prismatic_joint.h":"1$1fea3b9218d2cca3526a35c98dd3bb9cb979abebbedb3b2e636289d37e32725e","/usr/local/include/box2d/b2_pulley_joint.h":"1$b9378adc4759a8fca88cbc42a7f09cca4b0251dcd984224366ea9815c7aeb7a2","/usr/local/include/box2d/b2_revolute_joint.h":"1$7b8b4273dbcba53a04630feeedb83d4583c0dab60cb4c6dd2a7a210d89b29398","/usr/local/include/box2d/b2_rope.h":"1$e3afce6bb41b3e09a322f957721772bdd7e1790865b4aff7ead35e5a174f2ed0","/usr/local/include/box2d/b2_settings.h":"1$6d303f12328152cc415742863acd3df5f3e1ce0b025f39db53e6d8901344096a","/usr/local/include/box2d/b2_shape.h":"1$f6584a6eae8ec2701253c9dd2c55c598ae99a7f98c05eb23f09ff8e00883e03b","/usr/local/include/box2d/b2_stack_allocator.h":"1$0625b8d50ee540f753c7e480f46801752987dc378e839f0882e42b89981d973d","/usr/local/include/box2d/b2_time_of_impact.h":"1$19701991180d44b1bc86761d3dbecea2a59e367e813caedaef01f444206455f6","/usr/local/include/box2d/b2_time_step.h":"1$f77d28d2dc42dc275b303b2722b0870eccf54d34de415877357ffa36f21157d8","/usr/local/include/box2d/b2_timer.h":"1$f44eff4f97f8f6a80f964f1e1944232bba431504d13fbd6616aa35efe7eb8a39","/usr/local/include/box2d/b2_types.h":"1$8a5d7006c318e7b07823357d8e58d4e8e38cd2043812efd35f211f21bdfca563","/usr/local/include/box2d/b2_weld_joint.h":"1$11ca3a51560cf186cb89d4aa7186850fe9e2331ead46df04ce9a602f5ea3bbac","/usr/local/include/box2d/b2_wheel_joint.h":"1$d94512bef83a2c3dfc013e1fcc17414f6c859c2fb17ab5809ab25b92f346845d","/usr/local/include/box2d/b2_world.h":"1$45c4f6c80fd52589bb3a0560135781d98ea621c2da52ed49856e3f85a5ccc73f","/usr/local/include/box2d/b2_world_callbacks.h":"1$3c45fecd0df64de577985a19d1a8b5a237183ee1285cca6ca7a1c7e07960c922","/usr/local/include/box2d/box2d.h":"1$59c1e8a82f323245fde1aa3c9cd14da8016e92cebd053d45bca3d5aabd7c8215","/usr/local/lib/cmake/box2d/box2dConfig-release.cmake":"1$837826bca17329c94de2ca90f9811934bcc91a18e62400b05f7c29dd5df87524","/usr/local/lib/cmake/box2d/box2dConfig.cmake":"1$84ff6986854c24baf05805bddfcba3ac7c9ec5ce824da241933e7d7198b8e961","/usr/local/lib/cmake/box2d/box2dConfigVersion.cmake":"1$c02957cba266e7a065f35cc05015d4262f5f94aeb6572c3456c5a42188f47fae","/usr/local/lib/libbox2d.so":"1$d888c883ef814b66f9d13fa59d627f56ab393ac9a1cbd9a9cf68c59f1c703920","/usr/local/lib/libbox2d.so.2":"1$4a68cb4488cd8616aa6909867f16b0e702b2c0cb62d641ed60bb728746ef54a6","/usr/local/lib/libbox2d.so.2.4.1":"1$1f231e8f89d14629547f5ca41dad36eb90c4ef261420334190f045e91501c652","/usr/local/share/licenses/Box2D-2.4.1/LICENSE":"1$8a9617637463b68fc0584861100926c56e2af396c013024314c285549b9c9642","/usr/local/share/licenses/Box2D-2.4.1/MIT":"1$9b77e0763d3e1f5bb34aa54be173dd34377a29baf3cc4111fb48cf758b21efd8","/usr/local/share/licenses/Box2D-2.4.1/catalog.mk":"1$b4f2c27d29bb4b1daa1daabe672aaf99c9e1709f8da7260c9b47cdb11097e69b"},"scripts":{"post-install":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi","post-deinstall":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi"}} +{"name":"GentiumBasic","origin":"x11-fonts/gentium-basic","version":"1102_1","comment":"Gentium Basic and Gentium Book Basic TrueType fonts","maintainer":"matthew@FreeBSD.org","www":"https://software.sil.org/gentium/","abi":"FreeBSD:14:*","arch":"freebsd:14:*","prefix":"/usr/local","flatsize":2158431,"timestamp":1709152837,"licenselogic":"single","licenses":["OFL11"],"desc":"Gentium is a typeface family designed to enable the diverse ethnic\ngroups around the world who use the Latin, Cyrillic and Greek scripts\nto produce readable, high-quality publications. It supports a wide\nrange of Latin- and Cyrillic-based alphabets.\n\nGentium Basic and Gentium Book Basic are font families based on the\noriginal Gentium design, but with additional weights. The \"Book\"\nfamily is slightly heavier. Both families come with a complete\nregular, bold, italic and bold italic set of fonts.","deps":{"mkfontscale":{"origin":"x11-fonts/mkfontscale","version":"1.2.1_1"},"fontconfig":{"origin":"x11-fonts/fontconfig","version":"2.15.0_2,1"}},"categories":["x11-fonts"],"options":{"DOCS":"on"},"annotations":{"repo_type":"binary","repository":"durieux_family_poudriere"},"files":{"/usr/local/share/doc/GentiumBasic/FONTLOG.txt":"1$5233ef6e7bf44dfee3852ced98acc210a21bbf0d2181e748fefe3148117d9431","/usr/local/share/doc/GentiumBasic/GENTIUM-FAQ.txt":"1$3baa3cd43bf8f8e886a9647bffb70fc31a13d6c5635c7072321313e197bfb621","/usr/local/share/doc/GentiumBasic/OFL-FAQ.txt":"1$5d7519b9db1e8f743936e470d45a4c5215fd816ce79e934a5909cd8045bf0860","/usr/local/share/fonts/GentiumBasic/GenBasB.ttf":"1$26d5d4044a4bf92f265bf3b597076aa52d0497cb102cbdbfb1131f658ce97c9c","/usr/local/share/fonts/GentiumBasic/GenBasBI.ttf":"1$5bfddd753de0a9ad83940e9b6130a8082510416d7450bb8e39d90e7655a75e35","/usr/local/share/fonts/GentiumBasic/GenBasI.ttf":"1$191de1e709a691f1134775539dee8b2167baef3ee411744b5cdf3b43ce18707a","/usr/local/share/fonts/GentiumBasic/GenBasR.ttf":"1$f0248c5a6d76dca62c639fdfdde97f9ae60c05c96bec03925d522531d7c0ca37","/usr/local/share/fonts/GentiumBasic/GenBkBasB.ttf":"1$37fc25b7916e4055ffff0b9bda2b9a9efe7d3404773339fa8cde00a15d5589a9","/usr/local/share/fonts/GentiumBasic/GenBkBasBI.ttf":"1$dccbca56a0d1bdbcc440e3b2070ee0ef63fd834454196baeaa8226ead9c82f07","/usr/local/share/fonts/GentiumBasic/GenBkBasI.ttf":"1$6879e401a0c44c6473fb796c284112f3139bd20c289cff92e6c4abb4dab7d369","/usr/local/share/fonts/GentiumBasic/GenBkBasR.ttf":"1$f0e5c2d48408804caf9779ee2e039687b3ac5cf56edff51577fc0aedc0908994","/usr/local/share/licenses/GentiumBasic-1102_1/LICENSE":"1$ce8d6b960a394f2f24cc95bb5162153bb18e0d534bffad8c872d05bc62f30d7d","/usr/local/share/licenses/GentiumBasic-1102_1/OFL11":"1$e564f06d018e7b95bc3594c96a17f1d41865af4038c375e7aa974dd69df38602","/usr/local/share/licenses/GentiumBasic-1102_1/catalog.mk":"1$a19637648271793a256295027f98fd2912dd0363ffea330801904fc974a10ecc"},"directories":{"/usr/local/share/fonts/GentiumBasic":"y"},"lua_scripts":{"post-install":["fontdir = pkg.prefixed_path(\"/usr/local/share/fonts/GentiumBasic\")\n pkg.exec({\"mkfontscale\", fontdir})\n pkg.exec({\"mkfontdir\", fontdir})"],"post-deinstall":["fontdir = pkg.prefixed_path(\"/usr/local/share/fonts/GentiumBasic\")\n pkg.exec({\"mkfontscale\", fontdir})\n pkg.exec({\"mkfontdir\", fontdir})\n for _, v in pairs {\"/fonts.scale\", \"/fonts.dir\" } do\n local st = pkg.stat(fontdir .. v)\n if st and st.type == \"reg\" and st.size == 2 then\n os.remove(fontdir .. v)\n end\n end"]},"messages":[{"message":"To use these fonts, add the following line to the \"Files\" section of\nxorg.conf:\n\n\tFontPath \"/usr/local/share/fonts/GentiumBasic/\"\n\nUsers of older versions of X may additionally have to make sure that\nthe freetype module is loaded. Check /var/log/Xorg.0.log for error\nmessages. If freetype is required, add the following line to the\n\"Modules\" section of xorg.conf:\n\n\tLoad \"freetype\"","type":"install"}]} +{"name":"Imath","origin":"math/Imath","version":"3.1.10","comment":"C++/Python lib of 2D/3D vector, matrix, math ops for computer graphics","maintainer":"mandree@FreeBSD.org","www":"https://github.com/AcademySoftwareFoundation/Imath/","abi":"FreeBSD:14:amd64","arch":"freebsd:14:x86:64","prefix":"/usr/local","flatsize":883043,"timestamp":1709152565,"licenselogic":"single","licenses":["BSD3CLAUSE"],"desc":"Imath is a basic, light-weight, and efficient C++ representation of 2D and 3D\nvectors and matrices and other simple but useful mathematical objects,\nfunctions, and data types common in computer graphics applications, including\nthe \"half\" 16-bit floating-point type.\n\nImath also includes optional python bindings for all types and functions,\nincluding optimized implementations of vector and matrix arrays.\n\nImath was originally developed at Industrial Light & Magic in the early 2000's\nand was originally distributed as open source as a part of the OpenEXR project.\n\nImath continues to be maintained as a sub-project of OpenEXR, which is now a\nproject of the Academy Software Foundation. See the OpenEXR project's\nGOVERNANCE.md for more information about how the project operates.","categories":["math","graphics","devel"],"shlibs_provided":["libImath-3_1.so.29"],"options":{"DOCS":"on","LARGE_STACK":"off","PYTHON":"off"},"annotations":{"FreeBSD_version":"1400097","repo_type":"binary","repository":"durieux_family_poudriere"},"files":{"/usr/local/include/Imath/ImathBox.h":"1$c35706740e215352fab9251d5cdf9a34b68b97539d32aadc5f2ce7be4445b304","/usr/local/include/Imath/ImathBoxAlgo.h":"1$23de8f4c72902be693a7c6d1c41ce1ef06c0e29c951114ddbb5147e252908996","/usr/local/include/Imath/ImathColor.h":"1$515bb1acf00001260a55ab73a18c0318ac3b24f25031d88da24701826a4764b3","/usr/local/include/Imath/ImathColorAlgo.h":"1$0c4f89f3f6bc9b363467af8fda230557ffd52e6b2d5f6e7bab2fd3d44073d8da","/usr/local/include/Imath/ImathConfig.h":"1$ae807c44eda1465e23c7f291bb3d8d83deb30ee66e43e8ac9d85385113d7854b","/usr/local/include/Imath/ImathEuler.h":"1$6c886364cdd51d0acb5a5d53f198c980190ee981648b18d6b247843863a26413","/usr/local/include/Imath/ImathExport.h":"1$ea4893e470c083b3fb7604574c7e93ca409578d6ea5bb66517ee79000721506a","/usr/local/include/Imath/ImathForward.h":"1$e2ac76a1a6adec4c60a3bb3635e48de981b9836551fb297948679deb8362c835","/usr/local/include/Imath/ImathFrame.h":"1$78836037cad731d98e29ea671ee5503ac5e37c92ddab9cda932425b91ffe9984","/usr/local/include/Imath/ImathFrustum.h":"1$e4cc5a2d79f204c50fe7563712c70de0e9f1806648bfbb645d4d2112d7eed7de","/usr/local/include/Imath/ImathFrustumTest.h":"1$c24165bc83f3a995daebcdc422bca7815d6a982fe7c23fc0c75f528aa999b08c","/usr/local/include/Imath/ImathFun.h":"1$3a244e0d6ac36926656ab4a357a11bb7dc9ac1f04a27ea9c08bd13f354a64875","/usr/local/include/Imath/ImathGL.h":"1$13d8369a119d5a17be4d53a25895cfc072b86cda6a6a2501d3d58ac310059083","/usr/local/include/Imath/ImathGLU.h":"1$4ae59136773c3bc8481541c7b3ccab11b18ff6258a44241fa31ef193f6489ed6","/usr/local/include/Imath/ImathInt64.h":"1$ee211d0ab36019c0c787b6256c448c7017a6b3d9dfb69d016bbc46762d37baff","/usr/local/include/Imath/ImathInterval.h":"1$b0aea0e8adecbc00e99e634b08240d7ff60320e5dee3910d8f4ecf0c2b907608","/usr/local/include/Imath/ImathLine.h":"1$1de362fd8233b05769eab203232934fd211d52bbb120abffddf44e3046c4fa95","/usr/local/include/Imath/ImathLineAlgo.h":"1$77585b7c111f0a7ba9c0151e5f854fee7de0fc2265e561c22fc9b13b96ee3cf4","/usr/local/include/Imath/ImathMath.h":"1$4cda383cdb3d369c730cd4298443320a5b6b990a1250fa6c45c185541f169230","/usr/local/include/Imath/ImathMatrix.h":"1$5e9543442cba33870f6dc05eea6cfc0211670e89c17c3c6baa135f6512ca554e","/usr/local/include/Imath/ImathMatrixAlgo.h":"1$4efaed90e3496117b014e570aac5f55ea1db515fbc401002790e4eb635a2333c","/usr/local/include/Imath/ImathNamespace.h":"1$09f6dc5fadc97d2af0307b4e9d540e9dfcb913ee8150c2b83e4f5bcf7219c7c7","/usr/local/include/Imath/ImathPlane.h":"1$731ba536ea598869f40f079f41bbd3653b7fa5f84b753296cb28262bb87f7339","/usr/local/include/Imath/ImathPlatform.h":"1$3f38a97f8fce95d80750da3669a1a584d68a5ea57be80d9f9e1c1363412fe5b3","/usr/local/include/Imath/ImathQuat.h":"1$ca8af8da8a5974660b6b3718482b3dd31e32a32c1212ea30eb3285be734bb2ab","/usr/local/include/Imath/ImathRandom.h":"1$f1bc5482c792871cad750ca9f41789fe7e8be76264c62890c44a7e26835adc1a","/usr/local/include/Imath/ImathRoots.h":"1$6b4815492612443e2a9889a08296437ad736b792f7a57de08c9a1a1fe997fd86","/usr/local/include/Imath/ImathShear.h":"1$ab31239624140c5c401d6f1a384c7903a122329f0b05d6e483492c4acf159174","/usr/local/include/Imath/ImathSphere.h":"1$5194325daae7969e28a9457627acc2588b11181de470d91d6e09bce5a1cb2228","/usr/local/include/Imath/ImathTypeTraits.h":"1$7f02d4ac270c24547ed7ea8236e076335261b4681fe622dd6af4eba1b51d1390","/usr/local/include/Imath/ImathVec.h":"1$74f0bfe3d4887c5c48213a200cbf996ede4a40c4b56af46e01914a676d9acf0e","/usr/local/include/Imath/ImathVecAlgo.h":"1$7428eb1b9a1b72e33b2706d419c02c2f5c85c925fd1ba863ec417c0c343bf0ad","/usr/local/include/Imath/half.h":"1$ffa77a2ec12d4bb41eb5b2ccc77b9ab32f5a3aa71a5ad1f6c05203278a97926b","/usr/local/include/Imath/halfFunction.h":"1$a87555de3b79aba24457e05e180be381f7c945e353f75fe743e2c5e6d3ac2da3","/usr/local/include/Imath/halfLimits.h":"1$c0b12a6c005418f7160a016f18baacf16c8394113980f62c3baceede92dad76a","/usr/local/lib/cmake/Imath/ImathConfig.cmake":"1$b15341fca52cb1b72f54ea02cd8bae652ef43d28f7bb53e4b25b27a1501c3faf","/usr/local/lib/cmake/Imath/ImathConfigVersion.cmake":"1$f63fa92e26ee9cfcba4e04211cc300ab02a5585ed6a01bde46a5784c2cd897e1","/usr/local/lib/cmake/Imath/ImathTargets-release.cmake":"1$2c227e7a3bce511f529697dfb5ce2a022fbda40d9382473fcb563d4c86c438e5","/usr/local/lib/cmake/Imath/ImathTargets.cmake":"1$498e62c8c82a1a9610a6f9ccc46a39d62d9100009af829138c98fbeacaa31e4c","/usr/local/lib/libImath-3_1.so":"1$22eed1127a46afcdf0d00d5ff43b1fe5cffb238c940afc2112bc5f24c090b727","/usr/local/lib/libImath-3_1.so.29":"1$c0ba8b1adb00ab4db7bdaa985733b634195023f4d8f71a6009d72fdd426280a3","/usr/local/lib/libImath-3_1.so.29.9.0":"1$5deb93a59ce97c610c08d42fa93e7c5f2a6d62241cb334e7ca756048ed4d96d5","/usr/local/lib/libImath.so":"1$712e3417d44faaf1135aaf64c5554999f8bd0dd2020b2c6166d3e7fbdfbf26c3","/usr/local/libdata/pkgconfig/Imath.pc":"1$8b00009965f11ef91fe64c7eae49a54def60d66793673617cdccc2ef47b74375","/usr/local/share/doc/Imath/README.md":"1$b0674c0d36f34847c4ae16b45868fad640787e6c141d1c7330e2df580156a118","/usr/local/share/licenses/Imath-3.1.10/BSD3CLAUSE":"1$58340fb9af0bf1ebbc09925b918bee0026b567058053a92bb687a3c682c5938b","/usr/local/share/licenses/Imath-3.1.10/LICENSE":"1$dba31a5da2c9507fa0fc58af4447cb05d27ecac7e99b9cd195cbca1605bf7bb0","/usr/local/share/licenses/Imath-3.1.10/catalog.mk":"1$4ef2106b42728bbae3e1290b49e70458c933d5ae02cd607b2f59c12e19e23168"},"scripts":{"post-install":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi","post-deinstall":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi"}} +{"name":"aalib","origin":"graphics/aalib","version":"1.4.r5_14","comment":"ASCII art library","maintainer":"ports@FreeBSD.org","www":"https://aa-project.sourceforge.net/aalib/","abi":"FreeBSD:14:amd64","arch":"freebsd:14:x86:64","prefix":"/usr/local","flatsize":519166,"timestamp":1710580344,"licenselogic":"single","licenses":["LGPL20+"],"desc":"AA-lib is a low-level graphics library similar to many other libraries\nexcept for the fact that AA-lib does not require a graphics device! In\nfact, no \"graphical\" output is possible. AA-lib uses a modern, high-tech\nascii-art renderer in place of outmoded and cumbersome graphical output.\n\nThe AA-lib API is designed to be similar to that of other graphics\nlibraries so learning its API should be simple.","deps":{"indexinfo":{"origin":"print/indexinfo","version":"0.3.1"}},"categories":["graphics"],"shlibs_provided":["libaa.so.1"],"options":{"NCURSES":"on","SLANG":"off","X11":"off"},"annotations":{"FreeBSD_version":"1400097","repo_type":"binary","repository":"durieux_family_poudriere"},"files":{"/usr/local/bin/aafire":"1$93671e05fe14a528a375bdb740a603eedc7f5318f616c3cc30ea20f7cc212f1d","/usr/local/bin/aainfo":"1$82ecfed47c51028986651dca513aff58f4eb47b64a4c8eb5713f21e83cea0d0e","/usr/local/bin/aalib-config":"1$7cac02d7763091a8a20ba9cb5f7ed6b4e07855e0e85be4f90fb615fd2db53fe7","/usr/local/bin/aasavefont":"1$6035d8a38998fb86374afcfe28135465398077610057f765dcc4ed66fd1eba6a","/usr/local/bin/aatest":"1$95c397325ccd25554ed0996658a7abe4d192f2d7af711c70344a4f903841db71","/usr/local/include/aalib.h":"1$697a9627aef68a4971b65ceacfc04e114e30172c46ae31ab014b5f599a4e4a2a","/usr/local/lib/libaa.a":"1$134c61137d48feda6903958d49b9807253cf998b0130709d14ace1f4b3814a84","/usr/local/lib/libaa.so":"1$3a4772df5fee6f17eded121b2657ba0d497aca16d1b2ea7c2637a4a6a87a0de5","/usr/local/lib/libaa.so.1":"1$3a4772df5fee6f17eded121b2657ba0d497aca16d1b2ea7c2637a4a6a87a0de5","/usr/local/lib/libaa.so.1.0.4":"1$550a60dfe8bcb63966553a23640b946aa03830ea330eeec23763c7022951166e","/usr/local/share/aclocal/aalib.m4":"1$583ad482fc38a08e5161b140f877d1d75149ef0037e9d0d68ea130b445d4b1c4","/usr/local/share/info/aalib.info":"1$74afe707e588c33eed42591c7985f49b584353c19221d86fa730153d55c6b6d2","/usr/local/share/info/aalib.info-1":"1$966eb00376c72b626494fdddc7ab3d50d97a7ab216d0fbcec7cd12203e68eab9","/usr/local/share/info/aalib.info-2":"1$7923933c3988f114eb2edd7146fc2149302e54d1a6c306a408cee83f2e9da31c","/usr/local/share/info/aalib.info-3":"1$031c3d4d44234c441d3310bd1f4dc48abe1b1c8439cb6ff0ab28bfb2a9ce0509","/usr/local/share/licenses/aalib-1.4.r5_14/LGPL20+":"1$94b03f1a60a7fd5007149530626a895a6ef5a8b9342abfd56860c5f3956f5d23","/usr/local/share/licenses/aalib-1.4.r5_14/LICENSE":"1$35d0c883f7643c407d75e038d0de44f4483cecfe7dbe99d939aeea7edb64e17d","/usr/local/share/licenses/aalib-1.4.r5_14/catalog.mk":"1$aa034797546c7d622902030fb893d4ecfade12efaf694043a740b7b78ec230f4","/usr/local/share/man/man1/aafire.1.gz":"1$1c180ffd7646d53e57f4e0edd7756829febea72931a299546f3b7dcfc6765dd5","/usr/local/share/man/man3/aa_attrs.3.gz":"1$07bc4e0a546ff8ebd41f4a8a99d5ac689fdc6fb937151dc3f32f3c79b3d0644e","/usr/local/share/man/man3/aa_autoinit.3.gz":"1$d5d4ddd28217ab121fb9d47e916a28c1f097b8935e3b3f8e38336f23c95e7c7f","/usr/local/share/man/man3/aa_autoinitkbd.3.gz":"1$adbfa1f434e7855b9a3fda6d23fcb7de0edf38c7aa9307b29fd579765c39f624","/usr/local/share/man/man3/aa_autoinitmouse.3.gz":"1$fa45da6fc4be40889fc94177bc9a95c6f7dc06fb9263cfa2870a334aa5e4b53f","/usr/local/share/man/man3/aa_close.3.gz":"1$bdbc39eb9d2bcd6129c4d3cce8241e61b8b4d77ffac0e4d3af2f8547354d9da6","/usr/local/share/man/man3/aa_createedit.3.gz":"1$1061ec0db4ef8f96aff3efda5f5a62919e4631bb20e64cb64a93cbbc23446383","/usr/local/share/man/man3/aa_currentfont.3.gz":"1$fb8ae24b9416da4e5d1550bc77ab714af2c24c72f30e238445ee6baac88c0036","/usr/local/share/man/man3/aa_defparams.3.gz":"1$4fb957546658defb7ee232c1c486068148f2ca1a705208945b729c119e75be0a","/usr/local/share/man/man3/aa_defrenderparams.3.gz":"1$7a68b1e7529df864661992dc21afe46f74777ba6834f052b7f88e422d762fe89","/usr/local/share/man/man3/aa_displayrecommended.3.gz":"1$c8cc4643713447aaeae39cac019d1d2819954ca0f20230d714c6aa15179c82a6","/usr/local/share/man/man3/aa_dithernames.3.gz":"1$5ed67a82f43a71fac8c406c0683aa991a1c07297fc115940f6a89e8b9b084595","/usr/local/share/man/man3/aa_drivers.3.gz":"1$29c694de10d2c5912c7041f8b3e79fe0ebc92e16bca883cbdce1983581c0d5c9","/usr/local/share/man/man3/aa_edit.3.gz":"1$c48128bb06da476a13f53506cfb548082a883db0af15bcb786db8ff136bc2758","/usr/local/share/man/man3/aa_editkey.3.gz":"1$0c1ab94e02033f2037f4c70b4230e17ce0a7e82f212eb9a417f7f349057cad81","/usr/local/share/man/man3/aa_fastrender.3.gz":"1$dc14f24b7601587fe11647dfc610a8138a1b008eb8df977e28aeee64b5c530a5","/usr/local/share/man/man3/aa_fonts.3.gz":"1$7393c49f2031a7da10ef40d635369f0d9abb714f338f788523c94f633be23281","/usr/local/share/man/man3/aa_formats.3.gz":"1$df53d4af9b50ee2f8169cb01ec4e4869e78c1e426de2682e7e1c046805e745d3","/usr/local/share/man/man3/aa_getevent.3.gz":"1$7a92a5e69378d0e6296fb784e4a8bbc81c41b5bf12db39f368ae10e6f4ef9b95","/usr/local/share/man/man3/aa_getkey.3.gz":"1$11d1c657c5c1d40722e018e86668584c9422606e976f6a73877aac4bfb20c4e7","/usr/local/share/man/man3/aa_getmouse.3.gz":"1$2b1d0fab5438190dfbef1c879f8dd9664cadccbee0ab6a034acf482322027ffa","/usr/local/share/man/man3/aa_gotoxy.3.gz":"1$759d403e9ae6c461ceae73c2668205249350af8b5d6efedfec330095240d0072","/usr/local/share/man/man3/aa_help.3.gz":"1$e9449dbb6655afb5e53e277156ce4d6763dc46098b621105f8d1aad1df44eab0","/usr/local/share/man/man3/aa_hidecursor.3.gz":"1$6d1d4138bb91651f5c57d8fc3a5ab630e1d191568f0df8e457d6c2287c3baf1f","/usr/local/share/man/man3/aa_hidemouse.3.gz":"1$7c1e023a73868304e9e8bcc28e87a3405213995c84d7faee5efef869c5136a94","/usr/local/share/man/man3/aa_image.3.gz":"1$6a0aca2857091c455ec502424b9507c0713d0343bb1c3e090abecb2c58df2966","/usr/local/share/man/man3/aa_imgheight.3.gz":"1$f25bbefe1e36212f25cac973304429e64277e277f5aa8dffbf87fce808117fc4","/usr/local/share/man/man3/aa_imgwidth.3.gz":"1$88b0f9ac85e8c197260ea10a03e42fe860feed16dd5cc54e5742c55d95b9d6c6","/usr/local/share/man/man3/aa_init.3.gz":"1$72ab2fd7e80237ce6217a2d7b1792279a6ae950357f9e521dfeb060b9df8043b","/usr/local/share/man/man3/aa_initkbd.3.gz":"1$06df96b1c0b44d939a7950459493fa5570ea80fe262c1aeaae83127e0a0c7a0c","/usr/local/share/man/man3/aa_initmouse.3.gz":"1$5766b19ce39277d17f5f86f16cfae2166cf4bbdda416ad6177d02b1ad0bf716d","/usr/local/share/man/man3/aa_kbddrivers.3.gz":"1$fde133b9ee426e071b60f6444e7a853337a8fd3b0404fd7b4cd15da4e56bcb17","/usr/local/share/man/man3/aa_kbdrecommended.3.gz":"1$926982a7e4e9e16ff79642a4b315448f28701b67d9b08bbd2fdf0777263e0198","/usr/local/share/man/man3/aa_mmheight.3.gz":"1$f0073ed55324a6146fa318835650d36ea38cc128eae2e1f53d773e3d1bdf1048","/usr/local/share/man/man3/aa_mmwidth.3.gz":"1$d7661be3244436733d3fa3c5b2835d3b25292fc6c72d000b9ae5dd91adb39fa1","/usr/local/share/man/man3/aa_mousedrivers.3.gz":"1$8df9642698d8d683b2e8ab8fcc726175d170107e2e0114c7a3be24c49236c32b","/usr/local/share/man/man3/aa_mouserecommended.3.gz":"1$3ea579768cae655875734bc1eb1cb6440095cb25df72ff695b9470353ad34477","/usr/local/share/man/man3/aa_parseoptions.3.gz":"1$105523b66cad398aa083c50a48d5d7134b0f5e7dac5aae85f163dbb01f89a6ec","/usr/local/share/man/man3/aa_printf.3.gz":"1$8329e584e923998d4f84dd765ec4438b7deda78bafb2a5965a45c70b23fbb1fa","/usr/local/share/man/man3/aa_putpixel.3.gz":"1$5c5a3cd6c9a1d481086aa9e02c7812d192a36fd75b8627c9fe23f3d86db54ff5","/usr/local/share/man/man3/aa_puts.3.gz":"1$b1b7153bb62376eae2359e35e1a027e9db45c1dd4b5844f784edab166bf59181","/usr/local/share/man/man3/aa_recommendhi.3.gz":"1$83b050f918b209a77f6d03e5c83923ac4a670802f2f4c88ae8e2882c7738d57d","/usr/local/share/man/man3/aa_recommendhidisplay.3.gz":"1$fb5bf4ecaf85841c3c08e2c099f434d341154e2158470774c7aa304cee58d826","/usr/local/share/man/man3/aa_recommendhikbd.3.gz":"1$d8c8cb899f1c94c11f911b81bc8350113598bf7e428b05ebbd6b717bbc5fdfc6","/usr/local/share/man/man3/aa_recommendhimouse.3.gz":"1$0c79d379323e993b7b28b049d3c0abb59bb9ecdb9c90847d8a3dad00bab56aba","/usr/local/share/man/man3/aa_recommendlow.3.gz":"1$5835197a120a93fdb22c72abee0f0f723816d116d00a07d2ed34406b2400b195","/usr/local/share/man/man3/aa_recommendlowdisplay.3.gz":"1$22531d9eed86f96d540daa7093b57d83f6879bceed215a0228a306bebdfb1e2f","/usr/local/share/man/man3/aa_recommendlowkbd.3.gz":"1$c3a9cc5b6eefccf972ce1a79a823a8a94c6821b21fb919c08ad3fc956c379f56","/usr/local/share/man/man3/aa_recommendlowmouse.3.gz":"1$809ad5d60eeadfb4ed7d213a934736a68331ddcc8326c6b758894187cfed6476","/usr/local/share/man/man3/aa_registerfont.3.gz":"1$914fbf4d8561b734ccf3c002e3117d185c996f07a9d6e548380522b5d5636236","/usr/local/share/man/man3/aa_render.3.gz":"1$20ac481fcb0400330dd815056f8d28dad1e46a8a041e4f665e16d8dd43cee42d","/usr/local/share/man/man3/aa_resize.3.gz":"1$18cd9bbdbd73c375cb79df576c2d89fd9d9473d963bf7773a4bce9fb04a8e8e1","/usr/local/share/man/man3/aa_resizehandler.3.gz":"1$1328ac7506439098dfcd58585ea1b30ecd7a52b54855f1ed9c97961c61bf0b8d","/usr/local/share/man/man3/aa_scrheight.3.gz":"1$80ace6933ef414f4b221bd8c7d7177fbd6d17d304d3f48c1e2f51fa80cfc6ebe","/usr/local/share/man/man3/aa_scrwidth.3.gz":"1$2a014d6b8cd58d36830d03516b06e592056fef4e2667b507f4a1ee27b339c5b1","/usr/local/share/man/man3/aa_setfont.3.gz":"1$b6bb1c99f5bc0146e4099e0ca6a38f4f5bd5f4dff0ab7f73517adf31f28f0a17","/usr/local/share/man/man3/aa_setsupported.3.gz":"1$a53a522ae223b8fb78634724092ad1e5c0c5b9bb0e9e639b1a797a961bdd833c","/usr/local/share/man/man3/aa_showcursor.3.gz":"1$43d2fe5fcd4a019b4b66fa8c7c819d895f7ae66e8a531c084bcaada9f50850ab","/usr/local/share/man/man3/aa_showmouse.3.gz":"1$a8c5f246c0a5b9af12fd89026db7d96bbf86a5fd03933808a966b0bc89833491","/usr/local/share/man/man3/aa_text.3.gz":"1$448e35f426d90e7d7de91235981c8c999ff0f5b1f1f513b6a720c16bf7f6dc7e","/usr/local/share/man/man3/aa_uninitkbd.3.gz":"1$cc1c6f7886d9c975dd2d5a884807638ecc9b17f2da19ac617b2dc3082ca4c7fb","/usr/local/share/man/man3/aa_uninitmouse.3.gz":"1$d99f4dc27b6399306cdcc88216037bf24821b28a89bb210b480eaa9bba061c2e","/usr/local/share/man/man3/mem_d.3.gz":"1$1aea34fb5eb408a3972b900d8f991e7d9387e7f6be15e623f69e2a1f67151829","/usr/local/share/man/man3/save_d.3.gz":"1$4eface98ed7277e4726c85f7622164ec2761d182c0179879e89350810d3337ca"},"scripts":{"post-install":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi\n case \"/usr/local/share/info/aalib.info\" in\n /*) file=\"/usr/local/share/info/aalib.info\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-1\" in\n /*) file=\"/usr/local/share/info/aalib.info-1\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-1\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-2\" in\n /*) file=\"/usr/local/share/info/aalib.info-2\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-2\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-3\" in\n /*) file=\"/usr/local/share/info/aalib.info-3\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-3\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}","post-deinstall":"if ! /usr/sbin/service ldconfig restart >/dev/null; then\n\t\tif [ -z \"${INSTALL_AS_USER}\" ]; then\n\t\t\texit 1\n\t\tfi\n\tfi\n case \"/usr/local/share/info/aalib.info\" in\n /*) file=\"/usr/local/share/info/aalib.info\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-1\" in\n /*) file=\"/usr/local/share/info/aalib.info-1\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-1\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-2\" in\n /*) file=\"/usr/local/share/info/aalib.info-2\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-2\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}\n case \"/usr/local/share/info/aalib.info-3\" in\n /*) file=\"/usr/local/share/info/aalib.info-3\" ;;\n *) file=\"/usr/local//usr/local/share/info/aalib.info-3\" ;;\n esac\n indexinfo ${PKG_ROOTDIR}${file%25/*}"},"messages":[{"message":"===> NOTICE:\n\nThe aalib port currently does not have a maintainer. As a result, it is\nmore likely to have unresolved issues, not be up-to-date, or even be removed in\nthe future. To volunteer to maintain this port, please create an issue at:\n\nhttps://bugs.freebsd.org/bugzilla\n\nMore information about port maintainership is available at:\n\nhttps://docs.freebsd.org/en/articles/contributing/#ports-contributing"}]} +{"name":"bsddialog","origin":"devel/bsddialog","version":"1.0.1","comment":"Text User Interface Widgets","maintainer":"alfix86@gmail.com","www":"https://gitlab.com/alfix/bsddialog","abi":"FreeBSD:14:amd64","arch":"freebsd:14:x86:64","prefix":"/usr/local","flatsize":306377,"timestamp":1714125640,"licenselogic":"single","licenses":["BSD2CLAUSE"],"desc":"Utility (bsddialog(1)) and library (libbsddialog) to build scripts and tools\nwith TUI Widgets.","categories":["devel"],"shlibs_provided":["libbsddialog.so.1.0.1"],"annotations":{"FreeBSD_version":"1400097"},"files":{"/usr/local/bin/bsddialog":"1$491fca26acb5bbf1ff441ada8fe7ed07d568d80ff901c4b62a6968cbd2b3b1cb","/usr/local/include/bsddialog.h":"1$676c2d268ab1bb5acfb8921b0f32f3e9d75d82c02a098377c2235ec3a475e0b7","/usr/local/include/bsddialog_progressview.h":"1$9c3221eb2cbf741c4f9e6cf85a917e33bb3ab5fc87e550f0fd78260403673ab9","/usr/local/include/bsddialog_theme.h":"1$a914c496f9f1186fe3dc8c7cab91c93b878f23ad17183aa58ab80696eb431cbe","/usr/local/lib/libbsddialog.a":"1$7a101a92eff5abff35e5ea6b0f5a8734b85784498638be2a7fdd2e6d2267ce30","/usr/local/lib/libbsddialog.so":"1$20aaa40b6ac4423f888b0a01e44e13f553ab7be693b6b5ac4246225a08ae002e","/usr/local/lib/libbsddialog.so.1.0.1":"1$468d79993f3c8329b9a9e06422c4fdf6c4ac6f3bf36a9bee8e399766351b1956","/usr/local/share/licenses/bsddialog-1.0.1/BSD2CLAUSE":"1$a3430d21baad8e78d8f4593cdb63382d1231da53e37330f9cffe9e66cc604bcd","/usr/local/share/licenses/bsddialog-1.0.1/LICENSE":"1$5a0d3730c307e5043500dfa15cbf67dbd44c48215a7cacc445347d55b8c6bf77","/usr/local/share/licenses/bsddialog-1.0.1/catalog.mk":"1$9446cd70d40e88d4d4d927278525f3cdff269ae4ab93cea163a42f3eb43c475d","/usr/local/share/man/man1/bsddialog.1.gz":"1$707c9139e4ebb7a7f4ba58596e30f9271af93dc80ce24783124031bfbba58a34","/usr/local/share/man/man3/bsddialog.3.gz":"1$f56aa8acb3080c3b251180cfe562bfde7d3c799098c28523da7d5a857b744766"}} + diff --git a/tests/localinventory/data/software/snap_bare.dat b/tests/localinventory/data/software/snap_bare.dat new file mode 100644 index 0000000..0b73ca6 --- /dev/null +++ b/tests/localinventory/data/software/snap_bare.dat @@ -0,0 +1,19 @@ +name: bare +summary: Empty base snap, useful for testing and fully statically linked + snaps +publisher: Canonical** +store-url: https://snapcraft.io/bare +contact: snaps@canonical.com +license: unset +description: | + +type: base +snap-id: EISPgh06mRh1vordZY9OZ34QHdd7OrdR +tracking: latest/stable +refresh-date: 2024-05-20T22:46:00+02:00 +channels: + latest/stable: 1.0 2019-08-21T07:51:32Z (5) 4kB - + latest/candidate: ^ + latest/beta: ^ + latest/edge: 1.0 2017-07-26T06:56:36Z (5) 4kB - +installed: 1.0 (5) 4kB base diff --git a/tests/localinventory/data/software/snap_core18.dat b/tests/localinventory/data/software/snap_core18.dat new file mode 100644 index 0000000..10e601e --- /dev/null +++ b/tests/localinventory/data/software/snap_core18.dat @@ -0,0 +1,18 @@ +name: core18 +summary: Runtime environment based on Ubuntu 18.04 +publisher: Canonical** +store-url: https://snapcraft.io/core18 +contact: https://github.com/snapcore/core18/issues +license: unset +description: | + The base snap based on the Ubuntu 18.04 release. +type: base +snap-id: CSO04Jhav2yK0uz97cr0ipQRyqg0qQL6 +tracking: latest/stable +refresh-date: 2024-05-20T22:45:57+02:00 +channels: + latest/stable: 20240416 2024-04-27T03:10:03Z (2823) 58MB - + latest/candidate: 20240612 2024-06-21T12:30:05Z (2829) 58MB - + latest/beta: 20240612 2024-06-12T20:30:20Z (2829) 58MB - + latest/edge: 20240612 2024-06-12T18:32:14Z (2829) 58MB - +installed: 20240416 (2823) 58MB base diff --git a/tests/localinventory/data/software/snap_gnome-3-28-1804.dat b/tests/localinventory/data/software/snap_gnome-3-28-1804.dat new file mode 100644 index 0000000..0979a83 --- /dev/null +++ b/tests/localinventory/data/software/snap_gnome-3-28-1804.dat @@ -0,0 +1,18 @@ +name: gnome-3-28-1804 +summary: Shared GNOME 3.28 runtime for Ubuntu 18.04 +publisher: Canonical** +store-url: https://snapcraft.io/gnome-3-28-1804 +contact: https://gitlab.gnome.org/Community/Ubuntu/gnome-3-28-1804/issues +license: unset +description: | + This snap includes a GNOME 3.28 stack (the base libraries and desktop + integration components) and shares it through the content interface. +snap-id: TKv5Fm000l4XiUYJW9pjWHLkCPlDbIg1 +tracking: latest/stable +refresh-date: 2024-05-20T22:46:21+02:00 +channels: + latest/stable: 3.28.0-19-g98f9e67.98f9e67 2023-04-17T09:10:03Z (198) 172MB - + latest/candidate: 3.28.0-19-g98f9e67.98f9e67 2023-04-11T14:18:35Z (198) 172MB - + latest/beta: ^ + latest/edge: ^ +installed: 3.28.0-19-g98f9e67.98f9e67 (198) 172MB - diff --git a/tests/localinventory/data/software/snap_losslesscut.dat b/tests/localinventory/data/software/snap_losslesscut.dat new file mode 100644 index 0000000..3711517 --- /dev/null +++ b/tests/localinventory/data/software/snap_losslesscut.dat @@ -0,0 +1,28 @@ +name: losslesscut +summary: The swiss army knife of lossless video/audio editing +publisher: Mikael Finstad (mifino) +store-url: https://snapcraft.io/losslesscut +contact: finstaden@gmail.com +license: unset +description: | + LosslessCut aims to be the ultimate cross platform ffmpeg GUI for extremely + fast and lossless operations on video, audio, subtitle and other related + media files. The main feature is lossless trimming and cutting of video and + audio files, which is great for saving space by rough-cutting your large + video files taken from a video camera, GoPro, drone, etc. It lets you + quickly extract the good parts from your videos and discard many gigabytes + of data without doing a slow re-encode and thereby losing quality. Or you + can add a music or subtitle track to your video without needing to encode. + Everything is extremely fast because it does an almost direct data copy, + fueled by the awesome ffmpeg which does all the grunt work. +commands: + - losslesscut +snap-id: uRYH61YLB0C3jpYE5sUqf3Tr3KSfuILe +tracking: latest/stable +refresh-date: 2024-05-20T22:46:14+02:00 +channels: + latest/stable: 3.60.0 2024-01-05T14:52:54Z (129) 135MB - + latest/candidate: ^ + latest/beta: ^ + latest/edge: 3.61.1 2024-05-26T22:54:20Z (131) 141MB - +installed: 3.60.0 (129) 135MB - diff --git a/tests/localinventory/data/software/snap_snapd.dat b/tests/localinventory/data/software/snap_snapd.dat new file mode 100644 index 0000000..1eb84ec --- /dev/null +++ b/tests/localinventory/data/software/snap_snapd.dat @@ -0,0 +1,23 @@ +name: snapd +summary: Daemon and tooling that enable snap packages +publisher: Canonical** +store-url: https://snapcraft.io/snapd +contact: https://github.com/snapcore/snapd/issues +license: GPL-3.0 +description: | + Install, configure, refresh and remove snap packages. Snaps are + 'universal' packages that work across many different Linux systems, + enabling secure distribution of the latest apps and utilities for + cloud, servers, desktops and the internet of things. + + Start with 'snap list' to see installed snaps. +type: snapd +snap-id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4 +tracking: latest/stable +refresh-date: 2024-06-02T17:37:21+02:00 +channels: + latest/stable: 2.63 2024-05-23T19:10:03Z (21759) 40MB - + latest/candidate: 2.63 2024-05-16T08:33:06Z (21759) 40MB - + latest/beta: 2.63 2024-04-24T17:12:28Z (21759) 40MB - + latest/edge: 2.63+git344.gc6c677d 2024-06-25T17:56:48Z (22250) 38MB - +installed: 2.63 (21759) 40MB snapd diff --git a/tests/localinventory/data/software/snaplist.dat b/tests/localinventory/data/software/snaplist.dat new file mode 100644 index 0000000..5626a91 --- /dev/null +++ b/tests/localinventory/data/software/snaplist.dat @@ -0,0 +1,7 @@ +Name Version Rev Tracking Publisher Notes +bare 1.0 5 latest/stable canonical** base +core18 20240416 2823 latest/stable canonical** base +gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 198 latest/stable canonical** - +gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical** - +losslesscut 3.60.0 129 latest/stable mifino - +snapd 2.63 21759 latest/stable canonical** snapd diff --git a/tests/lshw.storage.json b/tests/lshw.storage.json new file mode 100644 index 0000000..f1b78cc --- /dev/null +++ b/tests/lshw.storage.json @@ -0,0 +1,147 @@ +[ + { + "id" : "nvme", + "class" : "storage", + "claimed" : true, + "handle" : "PCI:0000:02:00.0", + "description" : "NVMe device", + "product" : "CT2000P3PSSD8", + "vendor" : "Micron/Crucial Technology", + "physid" : "0", + "businfo" : "pci@0000:02:00.0", + "logicalname" : "/dev/nvme0", + "version" : "P9CR40A", + "serial" : "2339E879323C", + "width" : 64, + "clock" : 33000000, + "configuration" : { + "driver" : "nvme", + "latency" : "0", + "nqn" : "nqn.2014.08.org.nvmexpress:c0a9c0a92339E879323C CT2000P3PSSD8", + "state" : "live" + }, + "capabilities" : { + "nvme" : true, + "pciexpress" : "PCI Express", + "msix" : "MSI-X", + "msi" : "Message Signalled Interrupts", + "pm" : "Power Management", + "nvm_express" : true, + "bus_master" : "bus mastering", + "cap_list" : "PCI capabilities listing" + } + }, + { + "id" : "sas", + "class" : "storage", + "claimed" : true, + "handle" : "PCI:0000:05:00.0", + "description" : "Serial Attached SCSI controller", + "product" : "C602 chipset 4-Port SATA Storage Control Unit", + "vendor" : "Intel Corporation", + "physid" : "0", + "businfo" : "pci@0000:05:00.0", + "logicalname" : "scsi7", + "version" : "05", + "width" : 64, + "clock" : 33000000, + "configuration" : { + "driver" : "isci", + "latency" : "0" + }, + "capabilities" : { + "sas" : true, + "pm" : "Power Management", + "pciexpress" : "PCI Express", + "msix" : "MSI-X", + "bus_master" : "bus mastering", + "cap_list" : "PCI capabilities listing" + } + }, + { + "id" : "usb:1", + "class" : "storage", + "claimed" : true, + "handle" : "SCSI:06", + "description" : "Mass storage device", + "product" : "Mass Storage Device", + "vendor" : "Generic", + "physid" : "2", + "businfo" : "usb@5:2", + "logicalname" : "scsi6", + "version" : "1.00", + "serial" : "121220160204", + "configuration" : { + "driver" : "usb-storage", + "maxpower" : "100mA", + "speed" : "480Mbit/s" + }, + "capabilities" : { + "usb-2.00" : "USB 2.0", + "scsi" : "SCSI", + "emulated" : "Emulated device", + "scsi-host" : "SCSI host adapter" + } + }, + { + "id" : "nvme", + "class" : "storage", + "claimed" : true, + "handle" : "PCI:0000:08:00.0", + "description" : "NVMe device", + "product" : "WDS500G3XHC-00SJG0", + "vendor" : "Sandisk Corp", + "physid" : "0", + "businfo" : "pci@0000:08:00.0", + "logicalname" : "/dev/nvme1", + "version" : "102000WD", + "serial" : "205252800394", + "width" : 64, + "clock" : 33000000, + "configuration" : { + "driver" : "nvme", + "latency" : "0", + "nqn" : "nqn.2018-01.com.wdc:nguid:E8238FA6BF53-0001-001B448B48670125", + "state" : "live" + }, + "capabilities" : { + "nvme" : true, + "pm" : "Power Management", + "msi" : "Message Signalled Interrupts", + "msix" : "MSI-X", + "pciexpress" : "PCI Express", + "nvm_express" : true, + "bus_master" : "bus mastering", + "cap_list" : "PCI capabilities listing" + } + }, + { + "id" : "sata", + "class" : "storage", + "claimed" : true, + "handle" : "PCI:0000:00:1f.2", + "description" : "SATA controller", + "product" : "C600/X79 series chipset 6-Port SATA AHCI Controller", + "vendor" : "Intel Corporation", + "physid" : "1f.2", + "businfo" : "pci@0000:00:1f.2", + "logicalname" : ["scsi0", "scsi1"], + "version" : "05", + "width" : 32, + "clock" : 66000000, + "configuration" : { + "driver" : "ahci", + "latency" : "0" + }, + "capabilities" : { + "sata" : true, + "msi" : "Message Signalled Interrupts", + "pm" : "Power Management", + "ahci_1.0" : true, + "bus_master" : "bus mastering", + "cap_list" : "PCI capabilities listing", + "emulated" : "Emulated device" + } + } +] + diff --git a/tests/test.rs b/tests/test.rs new file mode 100644 index 0000000..e2df000 --- /dev/null +++ b/tests/test.rs @@ -0,0 +1,13 @@ +// Copyright (C) 2024 FusionSuite Team +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU Affero General Public License as published by the Free +// Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +// details. You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see . + +// https://doc.rust-lang.org/book/ch11-03-test-organization.html \ No newline at end of file