Skip to content

Commit c88c667

Browse files
authored
Add tests for wrlinux (#6688)
We support it. Let's test it. Signed-off-by: Tim Smith <tsmith84@gmail.com>
1 parent 2a19947 commit c88c667

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

providers/os/detector/detector_platform_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,17 @@ func TestKDENeonDetector(t *testing.T) {
11341134
assert.Equal(t, []string{"debian", "linux", "unix", "os"}, di.Family)
11351135
}
11361136

1137+
func TestWrlinuxDetector(t *testing.T) {
1138+
di, err := detectPlatformFromMock("./testdata/detect-wrlinux.toml")
1139+
assert.Nil(t, err, "was able to create the provider")
1140+
1141+
assert.Equal(t, "wrlinux", di.Name, "os name should be identified")
1142+
assert.Equal(t, "Wind River Linux 6.0.0.25", di.Title, "os title should be identified")
1143+
assert.Equal(t, "6.0.0.25", di.Version, "os version should be identified")
1144+
assert.Equal(t, "x86_64", di.Arch, "os arch should be identified")
1145+
assert.Equal(t, []string{"linux", "unix", "os"}, di.Family)
1146+
}
1147+
11371148
func TestQubesOSDetector(t *testing.T) {
11381149
di, err := detectPlatformFromMock("./testdata/detect-qubes.toml")
11391150
assert.Nil(t, err, "was able to create the provider")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[commands."uname -s"]
2+
stdout = "Linux"
3+
4+
[commands."uname -m"]
5+
stdout = "x86_64"
6+
7+
[commands."uname -r"]
8+
stdout = "6.6.54-yocto-standard"
9+
10+
[files."/etc/os-release"]
11+
content = """
12+
ID=wrlinux
13+
NAME=Wind River Linux
14+
VERSION=6.0.0.25
15+
VERSION_ID=6.0.0.25
16+
PRETTY_NAME=Wind River Linux 6.0.0.25
17+
"""

0 commit comments

Comments
 (0)