Add a test that the right directories are persisted.

pull/1072/head
dlorenc 2017-02-01 16:53:55 -08:00
parent b55e0997f4
commit fb910496a3
1 changed files with 26 additions and 0 deletions

View File

@ -38,6 +38,7 @@ func TestISO(t *testing.T) {
t.Run("permissions", testMountPermissions)
t.Run("packages", testPackages)
t.Run("persistence", testPersistence)
}
func testMountPermissions(t *testing.T) {
@ -89,3 +90,28 @@ func testPackages(t *testing.T) {
}
}
func testPersistence(t *testing.T) {
minikubeRunner := util.MinikubeRunner{
Args: *args,
BinaryPath: *binaryPath,
T: t}
for _, dir := range []string{
"/data",
"/var/lib/docker",
"/var/lib/cni",
"/var/lib/kubelet",
"/var/lib/localkube",
"/var/lib/rkt",
"/var/lib/boot2docker",
} {
output, err := minikubeRunner.SSH(fmt.Sprintf("df %s | tail -n 1 | awk '{print $1}'", dir))
if err != nil {
t.Errorf("Error checking device for %s. Error: %s.", dir, err)
}
if !strings.Contains(output, "/dev/sda1") {
t.Errorf("Path %s is not mounted persistently. %s", dir, output)
}
}
}