summaryrefslogtreecommitdiff
path: root/tests/profile.rs
blob: 19e648155a49ccaa4844a1886843a0de27737447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::Path;

use alt_controller_image::Profile;

#[test]
fn profile_expands_vendored_package_lists_and_discards_comments() {
    let profile = Profile::load(Path::new("profiles/alt-controller.profile"))
        .expect("target profile must parse");

    assert!(profile.packages.contains(&"basesystem".to_owned()));
    assert!(profile.packages.contains(&"openssh-server".to_owned()));
    assert!(profile.packages.contains(&"systemd-sysvinit".to_owned()));
    assert!(profile.packages.contains(&"libiec61850".to_owned()));
    assert!(!profile.packages.iter().any(|entry| entry.starts_with('#')));
    assert!(profile.regex_packages.contains(&"^kernel-(image|modules-())-(rt)$".to_owned()));
}