forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubevirt#3956 from AlonaKaplan/retValueAnyPrompt
tests: "utils.RetValue" no need to pass prompt
- Loading branch information
Showing
13 changed files
with
67 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
// mount iso ConfigMap image | ||
&expect.BSnd{S: "mount /dev/sda /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cat /mnt/option1 /mnt/option2 /mnt/option3\n"}, | ||
&expect.BExp{R: expectedOutput}, | ||
}, 200*time.Second) | ||
|
@@ -199,7 +199,7 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
// mount iso Secret image | ||
&expect.BSnd{S: "mount /dev/sda /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cat /mnt/user /mnt/password\n"}, | ||
&expect.BExp{R: expectedOutput}, | ||
}, 200*time.Second) | ||
|
@@ -282,7 +282,7 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
// mount service account iso image | ||
&expect.BSnd{S: "mount /dev/sda /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cat /mnt/namespace\n"}, | ||
&expect.BExp{R: tests.NamespaceTestDefault}, | ||
&expect.BSnd{S: "tail -c 20 /mnt/token\n"}, | ||
|
@@ -377,7 +377,7 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
&expect.BExp{R: "#"}, | ||
&expect.BSnd{S: "mount /dev/vdc /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cat /mnt/config1 /mnt/config2 /mnt/config3\n"}, | ||
&expect.BExp{R: expectedOutputCfgMap}, | ||
}, 200*time.Second) | ||
|
@@ -403,7 +403,7 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
// mount Secret image | ||
&expect.BSnd{S: "mount /dev/vdd /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cat /mnt/user /mnt/password\n"}, | ||
&expect.BExp{R: expectedOutputSecret}, | ||
}, 200*time.Second) | ||
|
@@ -501,13 +501,13 @@ var _ = Describe("[rfe_id:899][crit:medium][vendor:[email protected]][level:comp | |
&expect.BExp{R: "\\#"}, | ||
&expect.BSnd{S: "mount /dev/sda /mnt\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "grep \"PRIVATE KEY\" /mnt/ssh-privatekey\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "grep ssh-rsa /mnt/ssh-publickey\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
}, 200*time.Second) | ||
log.DefaultLogger().Object(vmi).Infof("%v", res) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,11 +211,11 @@ var _ = Describe("[rfe_id:588][crit:medium][vendor:[email protected]][level:comp | |
// mount virtio cdrom and check files are there | ||
&expect.BSnd{S: "mount -t iso9600 /dev/cdrom\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
&expect.BSnd{S: "cd /media/cdrom\n"}, | ||
&expect.BSnd{S: "ls virtio-win_license.txt guest-agent\n"}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", "\\#")}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
}, 200*time.Second) | ||
Expect(err).ToNot(HaveOccurred(), "expected virtio files to be mounted properly") | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,7 +367,7 @@ var _ = Describe("[rfe_id:3064][crit:medium][vendor:[email protected]][level:com | |
grepSleepPid := func(expecter expect.Expecter) string { | ||
res, err := tests.ExpectBatchWithValidatedSend(expecter, []expect.Batcher{ | ||
&expect.BSnd{S: `pgrep -f "sleep 5"` + "\n"}, | ||
&expect.BExp{R: tests.RetValue("[0-9]+", "\\# ")}, // pid | ||
&expect.BExp{R: tests.RetValue("[0-9]+")}, // pid | ||
}, 15*time.Second) | ||
log.DefaultLogger().Infof("a:%+v\n", res) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,7 @@ var _ = Describe("[rfe_id:151][crit:high][vendor:[email protected]][level:compon | |
&expect.BSnd{S: cmdCheck}, | ||
&expect.BExp{R: prompt}, | ||
&expect.BSnd{S: "echo $?\n"}, | ||
&expect.BExp{R: tests.RetValue("0", prompt)}, | ||
&expect.BExp{R: tests.RetValue("0")}, | ||
}, 15) | ||
Expect(err).ToNot(HaveOccurred()) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.