Skip to content

Commit

Permalink
add kola test for stable-root-symlink
Browse files Browse the repository at this point in the history
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
  • Loading branch information
nikita-dubrovskii committed Oct 26, 2021
1 parent ff7847a commit d0a7779
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mantle/kola/tests/coretest/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func init() {
"MachineID": register.CreateNativeFuncWrap(TestMachineID),
"RHCOSGrowpart": register.CreateNativeFuncWrap(TestRHCOSGrowfs, []string{"fcos"}...),
"FCOSGrowpart": register.CreateNativeFuncWrap(TestFCOSGrowfs, []string{"rhcos"}...),
"StableRoot": register.CreateNativeFuncWrap(TestStableRoot),
},
})
// TODO: Enable DockerPing/DockerEcho once fixed
Expand Down Expand Up @@ -92,6 +93,29 @@ func init() {
})
}

func TestStableRoot() error {
unit := "coreos-root-symlink.service"
link := "/dev/disk/by-label/coreos-root-disk"

if err := checkService(unit); err != nil {
return err
}

c := exec.Command("journalctl", "-o", "cat", "-u", unit)
out, err := c.Output()
if err != nil {
return fmt.Errorf("journalctl: %s", err)
}
if !strings.Contains(string(out), link) {
return fmt.Errorf("Symlink '%s' wasn't created", link)
}

if _, err := os.Stat(link); err == nil {
return fmt.Errorf("Symlink '%s' wasn't removed", link)
}
return nil
}

func TestPortSsh() error {
//t.Parallel()
err := CheckPort("tcp", "127.0.0.1:22", PortTimeout)
Expand Down

0 comments on commit d0a7779

Please sign in to comment.