Skip to content

Commit

Permalink
tests: empty iso: handle potentially paused target
Browse files Browse the repository at this point in the history
Signed-off-by: Jed Lejosne <[email protected]>
  • Loading branch information
jean-edouard committed Jun 10, 2022
1 parent 1fe20bb commit 99a6da6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2405,11 +2405,16 @@ var _ = Describe("[rfe_id:393][crit:high][vendor:[email protected]][level:system
continue
}
// Wait for the iso to be created
Eventually(func() string {
Eventually(func() error {
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "[[ -f " + volPath + " ]] && echo found || true"})
Expect(err).ToNot(HaveOccurred())
return output
}, 30*time.Second, time.Second).Should(ContainSubstring("found"), volPath+" never appeared")
if err != nil {
return err
}
if !strings.Contains(output, "found") {
return fmt.Errorf("%s never appeared", volPath)
}
return nil
}, 30*time.Second, time.Second).Should(Not(HaveOccurred()))
output, err := tests.RunCommandOnVmiTargetPod(vmi, []string{"/bin/bash", "-c", "/usr/bin/stat --printf=%s " + volPath})
Expect(err).ToNot(HaveOccurred())
Expect(strconv.Atoi(output)).To(Equal(int(volStatus.Size)), "ISO file for volume %s is not the right size", volume.Name)
Expand Down

0 comments on commit 99a6da6

Please sign in to comment.