kola/tests/misc: ignore dead links in certain paths
This changes the test to search everything instead of individual
file systems, and it adds a list of paths to exclude.
Specifically, rkt writes dead links under /var/lib and udev writes
dead links under /run, but it also ignores /proc, /sys, and /dev.
@@ -94,9 +94,20 @@ func sugidFiles(m platform.Machine, validfiles []string, mode string) error {
func DeadLinks(c cluster.TestCluster) error {
m := c.Machines()[0]
- output, err := m.SSH(`sudo find / /usr -ignore_readdir_race -xdev -xtype l`)
+ ignore := []string{
+ "/dev",
+ "/proc",
+ "/run/udev/watch",
+ "/sys",
+ "/var/lib/docker",
+ "/var/lib/rkt",
+ }
+
+ command := fmt.Sprintf("sudo find / -ignore_readdir_race -path %s -prune -o -xtype l -print", strings.Join(ignore, " -prune -o -path "))
+
+ output, err := m.SSH(command)
if err != nil {
- return fmt.Errorf("Failed to run find: output %s, status: %v", output, err)
+ return fmt.Errorf("Failed to run %v: output %s, status: %v", command, output, err)
}
if string(output) != "" {
