mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 21:30:41 +00:00
Fix tests
This commit is contained in:
parent
463c69ae10
commit
d557773763
3 changed files with 219 additions and 88 deletions
152
Cargo.lock
generated
152
Cargo.lock
generated
|
|
@ -61,14 +61,35 @@ version = "1.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-buffer"
|
||||||
|
version = "0.7.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
|
||||||
|
dependencies = [
|
||||||
|
"block-padding 0.1.5",
|
||||||
|
"byte-tools",
|
||||||
|
"byteorder",
|
||||||
|
"generic-array 0.12.4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-padding",
|
"block-padding 0.2.1",
|
||||||
"generic-array",
|
"generic-array 0.14.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-padding"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
|
||||||
|
dependencies = [
|
||||||
|
"byte-tools",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -77,6 +98,18 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
|
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byte-tools"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byteorder"
|
||||||
|
version = "1.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
@ -130,13 +163,22 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "digest"
|
||||||
|
version = "0.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.12.4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array",
|
"generic-array 0.14.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -161,6 +203,12 @@ dependencies = [
|
||||||
"synstructure",
|
"synstructure",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fake-simd"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
|
|
@ -173,6 +221,15 @@ dependencies = [
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "generic-array"
|
||||||
|
version = "0.12.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
|
||||||
|
dependencies = [
|
||||||
|
"typenum",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
|
|
@ -246,8 +303,10 @@ name = "libips"
|
||||||
version = "0.0.2-placeholder"
|
version = "0.0.2-placeholder"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"failure",
|
"failure",
|
||||||
"maplit",
|
"maplit 0.1.6",
|
||||||
"object",
|
"object",
|
||||||
|
"pest",
|
||||||
|
"pest_derive",
|
||||||
"regex",
|
"regex",
|
||||||
"sha2",
|
"sha2",
|
||||||
"sha3",
|
"sha3",
|
||||||
|
|
@ -259,6 +318,12 @@ version = "0.1.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22593015b8df7747861c69c28acd32589fb96c1686369f3b661d12e409d4cf65"
|
checksum = "22593015b8df7747861c69c28acd32589fb96c1686369f3b661d12e409d4cf65"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "maplit"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.3.4"
|
version = "2.3.4"
|
||||||
|
|
@ -285,6 +350,12 @@ dependencies = [
|
||||||
"wasmparser",
|
"wasmparser",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "opaque-debug"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "opaque-debug"
|
name = "opaque-debug"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
@ -297,6 +368,49 @@ version = "2.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85"
|
checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pest"
|
||||||
|
version = "2.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
|
||||||
|
dependencies = [
|
||||||
|
"ucd-trie",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pest_derive"
|
||||||
|
version = "2.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0"
|
||||||
|
dependencies = [
|
||||||
|
"pest",
|
||||||
|
"pest_generator",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pest_generator"
|
||||||
|
version = "2.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
|
||||||
|
dependencies = [
|
||||||
|
"pest",
|
||||||
|
"pest_meta",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pest_meta"
|
||||||
|
version = "2.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d"
|
||||||
|
dependencies = [
|
||||||
|
"maplit 1.0.2",
|
||||||
|
"pest",
|
||||||
|
"sha-1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkg6depotd"
|
name = "pkg6depotd"
|
||||||
version = "0.0.1-placeholder"
|
version = "0.0.1-placeholder"
|
||||||
|
|
@ -380,17 +494,29 @@ version = "0.1.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
|
checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha-1"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.7.3",
|
||||||
|
"digest 0.8.1",
|
||||||
|
"fake-simd",
|
||||||
|
"opaque-debug 0.2.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha2"
|
name = "sha2"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de"
|
checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.9.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpuid-bool",
|
"cpuid-bool",
|
||||||
"digest",
|
"digest 0.9.0",
|
||||||
"opaque-debug",
|
"opaque-debug 0.3.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -399,10 +525,10 @@ version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
|
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.9.0",
|
||||||
"digest",
|
"digest 0.9.0",
|
||||||
"keccak",
|
"keccak",
|
||||||
"opaque-debug",
|
"opaque-debug 0.3.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -458,6 +584,12 @@ version = "1.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
|
checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ucd-trie"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.7.1"
|
version = "1.7.1"
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,12 @@ use std::collections::{HashMap};
|
||||||
use std::fs::File as OsFile;
|
use std::fs::File as OsFile;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
use failure::Error;
|
|
||||||
use crate::payload::Payload;
|
use crate::payload::Payload;
|
||||||
use std::clone::Clone;
|
use std::clone::Clone;
|
||||||
use crate::digest::Digest;
|
use crate::digest::Digest;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::path::{Path};
|
use std::path::{Path};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use pest::Parser;
|
|
||||||
use crate::errors::Result;
|
use crate::errors::Result;
|
||||||
|
|
||||||
pub trait FacetedAction {
|
pub trait FacetedAction {
|
||||||
|
|
@ -189,8 +187,9 @@ impl Manifest {
|
||||||
self.files.push(f);
|
self.files.push(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_file(&mut self, f: Path) -> Result<Manifest> {
|
pub fn parse_file(&mut self, f: String) -> Result<()> {
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -231,7 +230,7 @@ pub enum ManifestError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[grammar = "manifest.pest"]
|
#[grammar = "actions/manifest.pest"]
|
||||||
struct ManifestParser;
|
struct ManifestParser;
|
||||||
|
|
||||||
pub fn parse_manifest_file(filename: String) -> Result<Manifest> {
|
pub fn parse_manifest_file(filename: String) -> Result<Manifest> {
|
||||||
|
|
@ -411,12 +410,14 @@ fn parse_file_action(line: String, line_nr: usize) -> Result<File> {
|
||||||
r#"([^ ]+)="(.+)"#
|
r#"([^ ]+)="(.+)"#
|
||||||
])?;
|
])?;
|
||||||
|
|
||||||
|
let mut p = Payload::default();
|
||||||
|
|
||||||
for (pat, idx) in regex_set.matches(line.trim_start()).into_iter().map(|match_idx| (®ex_set.patterns()[match_idx], match_idx)) {
|
for (pat, idx) in regex_set.matches(line.trim_start()).into_iter().map(|match_idx| (®ex_set.patterns()[match_idx], match_idx)) {
|
||||||
let regex = Regex::new(&pat)?;
|
let regex = Regex::new(&pat)?;
|
||||||
|
|
||||||
for cap in regex.captures_iter(line.clone().trim_start()) {
|
for cap in regex.captures_iter(line.clone().trim_start()) {
|
||||||
if idx == 0 {
|
if idx == 0 {
|
||||||
act.payload.primary_identifier = Digest::from_str(&cap[1])?;
|
p.primary_identifier = Digest::from_str(&cap[1])?;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -434,13 +435,13 @@ fn parse_file_action(line: String, line_nr: usize) -> Result<File> {
|
||||||
"sysattr" => act.sys_attr = clean_string_value(&cap[val_cap_idx]),
|
"sysattr" => act.sys_attr = clean_string_value(&cap[val_cap_idx]),
|
||||||
"overlay" => act.overlay = match string_to_bool(&cap[val_cap_idx]) {
|
"overlay" => act.overlay = match string_to_bool(&cap[val_cap_idx]) {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
Err(e) => return Err(ManifestError::InvalidAction {action: line, line: line_nr, message: e?})?
|
Err(e) => return Err(ManifestError::InvalidAction {action: line, line: line_nr, message: e.to_string()})?
|
||||||
},/
|
},
|
||||||
"preserve" => act.preserve = match string_to_bool(&cap[val_cap_idx]) {
|
"preserve" => act.preserve = match string_to_bool(&cap[val_cap_idx]) {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
Err(e) => return Err(ManifestError::InvalidAction {action: line, line: line_nr, message: e?})?
|
Err(e) => return Err(ManifestError::InvalidAction {action: line, line: line_nr, message: e.to_string()})?
|
||||||
},
|
},
|
||||||
"chash" | "pkg.content-hash" => act.payload.additional_identifiers.push(match Digest::from_str(clean_string_value(&cap[val_cap_idx]).as_str()) {
|
"chash" | "pkg.content-hash" => p.additional_identifiers.push(match Digest::from_str(clean_string_value(&cap[val_cap_idx]).as_str()) {
|
||||||
Ok(d) => d,
|
Ok(d) => d,
|
||||||
Err(e) => return Err(e)?
|
Err(e) => return Err(e)?
|
||||||
}),
|
}),
|
||||||
|
|
@ -459,6 +460,7 @@ fn parse_file_action(line: String, line_nr: usize) -> Result<File> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
act.payload = Some(p);
|
||||||
|
|
||||||
Ok(act)
|
Ok(act)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,9 @@ mod errors {
|
||||||
pub type Result<T> = StdResult<T, Error>;
|
pub type Result<T> = StdResult<T, Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
use errors::Result;
|
extern crate pest;
|
||||||
|
#[macro_use] extern crate pest_derive;
|
||||||
#[macro_use]
|
#[macro_use] extern crate failure;
|
||||||
extern crate failure;
|
|
||||||
extern crate maplit;
|
extern crate maplit;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
@ -25,11 +24,11 @@ mod tests {
|
||||||
|
|
||||||
use crate::actions::{Manifest, Property, Dir, File, Dependency, Facet};
|
use crate::actions::{Manifest, Property, Dir, File, Dependency, Facet};
|
||||||
use crate::actions::{parse_manifest_string, Attr};
|
use crate::actions::{parse_manifest_string, Attr};
|
||||||
use std::collections::HashSet;
|
use std::collections::{HashMap};
|
||||||
use crate::payload::Payload;
|
use crate::payload::Payload;
|
||||||
use crate::digest::{Digest, DigestAlgorithm, DigestSource};
|
use crate::digest::{Digest, DigestAlgorithm, DigestSource};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use failure::_core::ptr::hash;
|
use maplit::hashmap;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_attributes() {
|
fn parse_attributes() {
|
||||||
|
|
@ -51,80 +50,80 @@ mod tests {
|
||||||
set name=info.source-url value=http://www.pgpool.net/download.php?f=pgpool-II-3.3.1.tar.gz
|
set name=info.source-url value=http://www.pgpool.net/download.php?f=pgpool-II-3.3.1.tar.gz
|
||||||
set name=pkg.summary value=\\\"'XZ Utils - loss-less file compression application and library.'\\\"");
|
set name=pkg.summary value=\\\"'XZ Utils - loss-less file compression application and library.'\\\"");
|
||||||
|
|
||||||
let mut optional_hash = HashSet::new();
|
let mut optional_hash = HashMap::new();
|
||||||
optional_hash.insert(Property{key: String::from("optional"), value:String::from("testing")});
|
optional_hash.insert(String::from("optional"), Property{key: String::from("optional"), value:String::from("testing")});
|
||||||
optional_hash.insert(Property{key: String::from("optionalWithString"), value:String::from("test ing")});
|
optional_hash.insert(String::from("optionalWithString"), Property{key: String::from("optionalWithString"), value:String::from("test ing")});
|
||||||
|
|
||||||
let test_results = vec![
|
let test_results = vec![
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("pkg.fmri"),
|
key: String::from("pkg.fmri"),
|
||||||
values: vec![String::from("pkg://openindiana.org/web/server/nginx@1.18.0,5.11-2020.0.1.0:20200421T195136Z")],
|
values: vec![String::from("pkg://openindiana.org/web/server/nginx@1.18.0,5.11-2020.0.1.0:20200421T195136Z")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("com.oracle.info.name"),
|
key: String::from("com.oracle.info.name"),
|
||||||
values: vec![String::from("nginx"), String::from("test")],
|
values: vec![String::from("nginx"), String::from("test")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("userland.info.git-remote"),
|
key: String::from("userland.info.git-remote"),
|
||||||
values: vec![String::from("git://github.com/OpenIndiana/oi-userland.git")],
|
values: vec![String::from("git://github.com/OpenIndiana/oi-userland.git")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("userland.info.git-branch"),
|
key: String::from("userland.info.git-branch"),
|
||||||
values: vec![String::from("HEAD")],
|
values: vec![String::from("HEAD")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("userland.info.git-rev"),
|
key: String::from("userland.info.git-rev"),
|
||||||
values: vec![String::from("1665491ba61bd494bf73e2916cd2250f3024260e")],
|
values: vec![String::from("1665491ba61bd494bf73e2916cd2250f3024260e")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("pkg.summary"),
|
key: String::from("pkg.summary"),
|
||||||
values: vec![String::from("Nginx Webserver")],
|
values: vec![String::from("Nginx Webserver")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("info.classification"),
|
key: String::from("info.classification"),
|
||||||
values: vec![String::from("org.opensolaris.category.2008:Web Services/Application and Web Servers")],
|
values: vec![String::from("org.opensolaris.category.2008:Web Services/Application and Web Servers")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("info.upstream-url"),
|
key: String::from("info.upstream-url"),
|
||||||
values: vec![String::from("http://nginx.net/")],
|
values: vec![String::from("http://nginx.net/")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("info.source-url"),
|
key: String::from("info.source-url"),
|
||||||
values: vec![String::from("http://nginx.org/download/nginx-1.18.0.tar.gz")],
|
values: vec![String::from("http://nginx.org/download/nginx-1.18.0.tar.gz")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("org.opensolaris.consolidation"),
|
key: String::from("org.opensolaris.consolidation"),
|
||||||
values: vec![String::from("userland")],
|
values: vec![String::from("userland")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("com.oracle.info.version"),
|
key: String::from("com.oracle.info.version"),
|
||||||
values: vec![String::from("1.18.0")],
|
values: vec![String::from("1.18.0")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("pkg.summary"),
|
key: String::from("pkg.summary"),
|
||||||
values: vec![String::from("provided mouse accessibility enhancements")],
|
values: vec![String::from("provided mouse accessibility enhancements")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("info.upstream"),
|
key: String::from("info.upstream"),
|
||||||
values: vec![String::from("X.Org Foundation")],
|
values: vec![String::from("X.Org Foundation")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("pkg.description"),
|
key: String::from("pkg.description"),
|
||||||
values: vec![String::from("Latvian language support's extra files")],
|
values: vec![String::from("Latvian language support's extra files")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("variant.arch"),
|
key: String::from("variant.arch"),
|
||||||
|
|
@ -134,12 +133,12 @@ mod tests {
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("info.source-url"),
|
key: String::from("info.source-url"),
|
||||||
values: vec![String::from("http://www.pgpool.net/download.php?f=pgpool-II-3.3.1.tar.gz")],
|
values: vec![String::from("http://www.pgpool.net/download.php?f=pgpool-II-3.3.1.tar.gz")],
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
},
|
},
|
||||||
Attr{
|
Attr{
|
||||||
key: String::from("pkg.summary"),
|
key: String::from("pkg.summary"),
|
||||||
values: vec![String::from("'XZ Utils - loss-less file compression application and library.'")], //TODO knock out the single quotes
|
values: vec![String::from("'XZ Utils - loss-less file compression application and library.'")], //TODO knock out the single quotes
|
||||||
properties: HashSet::new(),
|
properties: HashMap::new(),
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -247,7 +246,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
|
|
||||||
let test_results = vec![
|
let test_results = vec![
|
||||||
File{
|
File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("4b76e83bb4bb7c87176b72ef805fe78ecae60d2c"),
|
hash: String::from("4b76e83bb4bb7c87176b72ef805fe78ecae60d2c"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -269,7 +268,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "555".to_string(),
|
mode: "555".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -285,7 +284,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("72e0496a02e72e7380b0b62cdc8410108302876f"),
|
hash: String::from("72e0496a02e72e7380b0b62cdc8410108302876f"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -307,7 +306,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "sys".to_string(),
|
group: "sys".to_string(),
|
||||||
mode: "0444".to_string(),
|
mode: "0444".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -326,7 +325,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("95de71d58b37f9f74bede0e91bc381d6059fc2d7"),
|
hash: String::from("95de71d58b37f9f74bede0e91bc381d6059fc2d7"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -348,7 +347,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0444".to_string(),
|
mode: "0444".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -364,7 +363,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("7dd71afcfb14e105e80b0c0d7fce370a28a41f0a"),
|
hash: String::from("7dd71afcfb14e105e80b0c0d7fce370a28a41f0a"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -386,7 +385,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0444".to_string(),
|
mode: "0444".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -402,7 +401,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("cbf596ddb3433a8e0d325f3c188bec9c1bb746b3"),
|
hash: String::from("cbf596ddb3433a8e0d325f3c188bec9c1bb746b3"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -424,7 +423,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -441,7 +440,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("da38e2a0dded838afbe0eade6cb837ac30fd8046"),
|
hash: String::from("da38e2a0dded838afbe0eade6cb837ac30fd8046"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -463,7 +462,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -480,7 +479,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("407cb51b397ba4ad90a2246640a81af18e2e917a"),
|
hash: String::from("407cb51b397ba4ad90a2246640a81af18e2e917a"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -502,7 +501,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -519,7 +518,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("19ec7fb71e7f00d7e8a1cfc1013490f0cfee572b"),
|
hash: String::from("19ec7fb71e7f00d7e8a1cfc1013490f0cfee572b"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -541,7 +540,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -558,7 +557,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("e39dbc36680b717ec902fadc805a302f1cf62245"),
|
hash: String::from("e39dbc36680b717ec902fadc805a302f1cf62245"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -580,7 +579,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -597,7 +596,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("d143ca7a6aac765d28724af54d969a4bd2202383"),
|
hash: String::from("d143ca7a6aac765d28724af54d969a4bd2202383"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -619,7 +618,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -636,7 +635,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("379c1e2a2a5ffb8c91a07328d4c9be2bc58799fd"),
|
hash: String::from("379c1e2a2a5ffb8c91a07328d4c9be2bc58799fd"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -658,7 +657,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -675,7 +674,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("cc2fcdb4605dcac23d59f667889ccbdfdc6e3668"),
|
hash: String::from("cc2fcdb4605dcac23d59f667889ccbdfdc6e3668"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -697,7 +696,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -714,7 +713,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("e10f2d42c9e581901d810928d01a3bf8f3372838"),
|
hash: String::from("e10f2d42c9e581901d810928d01a3bf8f3372838"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -736,7 +735,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0644".to_string(),
|
mode: "0644".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -753,7 +752,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
],
|
],
|
||||||
..File::default()
|
..File::default()
|
||||||
}, File{
|
}, File{
|
||||||
payload: Payload{
|
payload: Some(Payload{
|
||||||
primary_identifier: Digest {
|
primary_identifier: Digest {
|
||||||
hash: String::from("6d5f820bb1d67594c7b757c79ef6f9242df49e98"),
|
hash: String::from("6d5f820bb1d67594c7b757c79ef6f9242df49e98"),
|
||||||
..Digest::default()
|
..Digest::default()
|
||||||
|
|
@ -785,7 +784,7 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
..Payload::default()
|
..Payload::default()
|
||||||
},
|
}),
|
||||||
group: "bin".to_string(),
|
group: "bin".to_string(),
|
||||||
mode: "0555".to_string(),
|
mode: "0555".to_string(),
|
||||||
owner: "root".to_string(),
|
owner: "root".to_string(),
|
||||||
|
|
@ -812,7 +811,6 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut manifest = Manifest::new();
|
|
||||||
let res = parse_manifest_string(manifest_string);
|
let res = parse_manifest_string(manifest_string);
|
||||||
assert!(res.is_ok(), "error during Manifest parsing: {:?}", res);
|
assert!(res.is_ok(), "error during Manifest parsing: {:?}", res);
|
||||||
let manifest = res.unwrap();
|
let manifest = res.unwrap();
|
||||||
|
|
@ -820,23 +818,23 @@ file 6d5f820bb1d67594c7b757c79ef6f9242df49e98 chash=3ab17dde089f1eac7abd37d8efd7
|
||||||
assert_eq!(manifest.files.len(), test_results.len());
|
assert_eq!(manifest.files.len(), test_results.len());
|
||||||
|
|
||||||
for (pos, file) in manifest.files.iter().enumerate() {
|
for (pos, file) in manifest.files.iter().enumerate() {
|
||||||
println!("action: {}", file.payload.primary_identifier.hash);
|
println!("action: {}", file.payload.as_ref().unwrap().primary_identifier.hash);
|
||||||
assert_eq!(file.group, test_results[pos].group);
|
assert_eq!(file.group, test_results[pos].group);
|
||||||
assert_eq!(file.mode, test_results[pos].mode);
|
assert_eq!(file.mode, test_results[pos].mode);
|
||||||
assert_eq!(file.owner, test_results[pos].owner);
|
assert_eq!(file.owner, test_results[pos].owner);
|
||||||
assert_eq!(file.path, test_results[pos].path);
|
assert_eq!(file.path, test_results[pos].path);
|
||||||
assert_eq!(file.preserve, test_results[pos].preserve);
|
assert_eq!(file.preserve, test_results[pos].preserve);
|
||||||
assert_eq!(file.payload.primary_identifier.hash, test_results[pos].payload.primary_identifier.hash);
|
assert_eq!(file.payload.as_ref().unwrap().primary_identifier.hash, test_results[pos].payload.as_ref().unwrap().primary_identifier.hash);
|
||||||
|
|
||||||
for (vpos, val) in file.properties.iter().enumerate() {
|
for (vpos, val) in file.properties.iter().enumerate() {
|
||||||
assert_eq!(val.key, test_results[pos].properties[vpos].key);
|
assert_eq!(val.key, test_results[pos].properties[vpos].key);
|
||||||
assert_eq!(val.value, test_results[pos].properties[vpos].value);
|
assert_eq!(val.value, test_results[pos].properties[vpos].value);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vpos, val) in file.payload.additional_identifiers.iter().enumerate() {
|
for (vpos, val) in file.payload.as_ref().unwrap().additional_identifiers.iter().enumerate() {
|
||||||
assert_eq!(val.hash, test_results[pos].payload.additional_identifiers[vpos].hash);
|
assert_eq!(val.hash, test_results[pos].payload.as_ref().unwrap().additional_identifiers[vpos].hash);
|
||||||
assert_eq!(val.source, test_results[pos].payload.additional_identifiers[vpos].source);
|
assert_eq!(val.source, test_results[pos].payload.as_ref().unwrap().additional_identifiers[vpos].source);
|
||||||
assert_eq!(val.algorithm, test_results[pos].payload.additional_identifiers[vpos].algorithm);
|
assert_eq!(val.algorithm, test_results[pos].payload.as_ref().unwrap().additional_identifiers[vpos].algorithm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -863,8 +861,8 @@ depend facet.version-lock.system/mozilla-nss=true fmri=system/mozilla-nss@3.51.1
|
||||||
Dependency{
|
Dependency{
|
||||||
fmri: "pkg:/system/data/hardware-registry@2020.2.22,5.11-2020.0.1.19951".to_string(),
|
fmri: "pkg:/system/data/hardware-registry@2020.2.22,5.11-2020.0.1.19951".to_string(),
|
||||||
dependency_type: "incorporate".to_string(),
|
dependency_type: "incorporate".to_string(),
|
||||||
facets: hashset!{
|
facets: hashmap!{
|
||||||
Facet{
|
"version-lock.system/data/hardware-registry".to_string() => Facet{
|
||||||
name: "version-lock.system/data/hardware-registry".to_string(),
|
name: "version-lock.system/data/hardware-registry".to_string(),
|
||||||
value: "true".to_string(),
|
value: "true".to_string(),
|
||||||
}
|
}
|
||||||
|
|
@ -874,8 +872,8 @@ depend facet.version-lock.system/mozilla-nss=true fmri=system/mozilla-nss@3.51.1
|
||||||
Dependency{
|
Dependency{
|
||||||
fmri: "xvm@0.5.11-2015.0.2.0".to_string(),
|
fmri: "xvm@0.5.11-2015.0.2.0".to_string(),
|
||||||
dependency_type: "incorporate".to_string(),
|
dependency_type: "incorporate".to_string(),
|
||||||
facets: hashset!{
|
facets: hashmap!{
|
||||||
Facet{
|
"version-lock.xvm".to_string() => Facet{
|
||||||
name: "version-lock.xvm".to_string(),
|
name: "version-lock.xvm".to_string(),
|
||||||
value: "true".to_string(),
|
value: "true".to_string(),
|
||||||
}
|
}
|
||||||
|
|
@ -885,8 +883,8 @@ depend facet.version-lock.system/mozilla-nss=true fmri=system/mozilla-nss@3.51.1
|
||||||
Dependency{
|
Dependency{
|
||||||
fmri: "system/mozilla-nss@3.51.1-2020.0.1.0".to_string(),
|
fmri: "system/mozilla-nss@3.51.1-2020.0.1.0".to_string(),
|
||||||
dependency_type: "incorporate".to_string(),
|
dependency_type: "incorporate".to_string(),
|
||||||
facets: hashset!{
|
facets: hashmap!{
|
||||||
Facet{
|
"version-lock.system/mozilla-nss".to_string() => Facet{
|
||||||
name: "version-lock.system/mozilla-nss".to_string(),
|
name: "version-lock.system/mozilla-nss".to_string(),
|
||||||
value: "true".to_string(),
|
value: "true".to_string(),
|
||||||
}
|
}
|
||||||
|
|
@ -895,7 +893,6 @@ depend facet.version-lock.system/mozilla-nss=true fmri=system/mozilla-nss@3.51.1
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut manifest = Manifest::new();
|
|
||||||
let res = parse_manifest_string(manifest_string);
|
let res = parse_manifest_string(manifest_string);
|
||||||
assert!(res.is_ok(), "error during Manifest parsing: {:?}", res);
|
assert!(res.is_ok(), "error during Manifest parsing: {:?}", res);
|
||||||
let manifest = res.unwrap();
|
let manifest = res.unwrap();
|
||||||
|
|
@ -904,8 +901,8 @@ depend facet.version-lock.system/mozilla-nss=true fmri=system/mozilla-nss@3.51.1
|
||||||
for (pos, dependency) in manifest.dependencies.iter().enumerate() {
|
for (pos, dependency) in manifest.dependencies.iter().enumerate() {
|
||||||
assert_eq!(dependency.fmri, test_results[pos].fmri);
|
assert_eq!(dependency.fmri, test_results[pos].fmri);
|
||||||
assert_eq!(dependency.dependency_type, test_results[pos].dependency_type);
|
assert_eq!(dependency.dependency_type, test_results[pos].dependency_type);
|
||||||
for (vpos, facet) in dependency.facets.iter().enumerate() {
|
for (_, (key, facet)) in dependency.facets.iter().enumerate() {
|
||||||
let fres = test_results[pos].facets.get(facet);
|
let fres = test_results[pos].facets.get(key);
|
||||||
assert!(fres.is_some(), "error no facet with name: {:?} found", facet.name);
|
assert!(fres.is_some(), "error no facet with name: {:?} found", facet.name);
|
||||||
let f = fres.unwrap();
|
let f = fres.unwrap();
|
||||||
assert_eq!(facet.name, f.name);
|
assert_eq!(facet.name, f.name);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue