Skip to content

Commit

Permalink
Add openEuler and OpenCloudOS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leavelet committed Dec 31, 2022
1 parent faad546 commit eb9977d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions os_info/src/linux/file_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,29 @@ mod tests {
assert_eq!(info, None);
}

#[test]
fn opencloudos_os_release() {
let root = "src/linux/tests/OpenCloudOS";

let info = retrieve(&DISTRIBUTIONS, root).unwrap();
assert_eq!(info.os_type(), Type::OpenCloudOS);
assert_eq!(info.version, Version::Semantic(8, 6, 0));
assert_eq!(info.edition, None);
assert_eq!(info.codename, None);
}

#[test]
fn openeuler_os_release() {
let root = "src/linux/tests/openEuler";

let info = retrieve(&DISTRIBUTIONS, root).unwrap();
assert_eq!(info.os_type(), Type::openEuler);
assert_eq!(info.version, Version::Semantic(22, 3, 0));
assert_eq!(info.edition, None);
assert_eq!(info.codename, None);

}

#[test]
fn oracle_linux_os_release() {
let root = "src/linux/tests/OracleLinux";
Expand Down
9 changes: 9 additions & 0 deletions os_info/src/linux/tests/OpenCloudOS/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NAME="OpenCloudOS"
VERSION="8.6"
ID="opencloudos"
ID_LIKE="rhel fedora centos"
VERSION_ID="8.6"
PLATFORM_ID="platform:oc8"
PRETTY_NAME="OpenCloudOS 8.6"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:opencloudos:opencloudos:8"
6 changes: 6 additions & 0 deletions os_info/src/linux/tests/openEuler/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NAME="openEuler"
VERSION="22.03 LTS"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 LTS"
ANSI_COLOR="0;31"

0 comments on commit eb9977d

Please sign in to comment.