Skip to content

Commit

Permalink
mantle/kola: update fcos.users.shells test for sbin/bin merge
Browse files Browse the repository at this point in the history
Now most of the entries are `/usr/bin/nologin`.

https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
  • Loading branch information
dustymabe committed Jan 20, 2025
1 parent 41c6b42 commit c9df100
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mantle/kola/tests/misc/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package misc

import (
"slices"
"strings"

"github.com/coreos/coreos-assembler/mantle/kola/cluster"
Expand Down Expand Up @@ -42,6 +43,12 @@ func CheckUserShells(c cluster.TestCluster) {
"halt": "/sbin/halt",
"core": "/bin/bash",
}
nologins := []string{
"/usr/bin/nologin",
"/usr/sbin/nologin",
"/sbin/nologin",
"/bin/nologin",
}

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

Expand All @@ -61,7 +68,7 @@ func CheckUserShells(c cluster.TestCluster) {
if shell != "/bin/bash" && shell != "/bin/sh" {
badusers = append(badusers, user)
}
} else if shell != ValidUsers[username] && shell != "/sbin/nologin" && shell != "/usr/sbin/nologin" {
} else if shell != ValidUsers[username] && !slices.Contains(nologins, shell) {
badusers = append(badusers, user)
}
}
Expand Down

0 comments on commit c9df100

Please sign in to comment.