mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
Modify machine "Remove machine" test
Modifies the "Remove machine" test to verify the system connections are handled properly on removal. Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
@ -43,6 +43,33 @@ var _ = Describe("podman machine rm", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(removeSession2).To(Exit(125))
|
||||
Expect(removeSession2.errorToString()).To(ContainSubstring(fmt.Sprintf("%s: VM does not exist", name)))
|
||||
|
||||
// Ensure that the system connections have the right rootfulness
|
||||
name = randomString()
|
||||
i = new(initMachine)
|
||||
session, err = mb.setName(name).setCmd(i.withImage(mb.imagePath)).run()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(session).To(Exit(0))
|
||||
|
||||
name2 := randomString()
|
||||
i = new(initMachine)
|
||||
session, err = mb.setName(name2).setCmd(i.withImage(mb.imagePath).withRootful(true)).run()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(session).To(Exit(0))
|
||||
|
||||
bm := basicMachine{}
|
||||
sysConnOutput, err := mb.setCmd(bm.withPodmanCommand([]string{"system", "connection", "list", "--format", "{{.Name}}--{{.Default}}"})).run()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(sysConnOutput.outputToString()).To(ContainSubstring(name + "--true"))
|
||||
|
||||
rm = rmMachine{}
|
||||
removeSession, err = mb.setName(name).setCmd(rm.withForce()).run()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(removeSession).To(Exit(0))
|
||||
|
||||
sysConnOutput, err = mb.setCmd(bm.withPodmanCommand([]string{"system", "connection", "list", "--format", "{{.Name}}--{{.Default}}"})).run()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(sysConnOutput.outputToString()).To(ContainSubstring(name2 + "-root--true"))
|
||||
})
|
||||
|
||||
It("Remove running machine", func() {
|
||||
|
Reference in New Issue
Block a user