Skip to content

Commit c9df100

Browse files
committed
mantle/kola: update fcos.users.shells test for sbin/bin merge
Now most of the entries are `/usr/bin/nologin`. https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
1 parent 41c6b42 commit c9df100

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mantle/kola/tests/misc/users.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package misc
1616

1717
import (
18+
"slices"
1819
"strings"
1920

2021
"github.com/coreos/coreos-assembler/mantle/kola/cluster"
@@ -42,6 +43,12 @@ func CheckUserShells(c cluster.TestCluster) {
4243
"halt": "/sbin/halt",
4344
"core": "/bin/bash",
4445
}
46+
nologins := []string{
47+
"/usr/bin/nologin",
48+
"/usr/sbin/nologin",
49+
"/sbin/nologin",
50+
"/bin/nologin",
51+
}
4552

4653
output := c.MustSSH(m, "getent passwd")
4754

@@ -61,7 +68,7 @@ func CheckUserShells(c cluster.TestCluster) {
6168
if shell != "/bin/bash" && shell != "/bin/sh" {
6269
badusers = append(badusers, user)
6370
}
64-
} else if shell != ValidUsers[username] && shell != "/sbin/nologin" && shell != "/usr/sbin/nologin" {
71+
} else if shell != ValidUsers[username] && !slices.Contains(nologins, shell) {
6572
badusers = append(badusers, user)
6673
}
6774
}

0 commit comments

Comments
 (0)