add unit test for gid
Verify that the gid can be only used together with the uid.
@@ -156,6 +156,13 @@ var _ = Describe("Guestfs shell", func() {
Expect(err).To(HaveOccurred())
Expect(err.Error()).Should(Equal(fmt.Sprintf("cannot set uid if root is true")))
})
+ It("GID can be use only together with the uid flag", func() {
+ guestfs.SetClient(fakeCreateClientPVC)
+ cmd := virtctlcmd.NewRepeatableVirtctlCommand(commandName, pvcName, "--gid=1001")
+ err := cmd()
+ Expect(err).To(HaveOccurred())
+ Expect(err.Error()).Should(Equal(fmt.Sprintf("gid requires the uid to be set")))
+ })
})
Context("URL authenticity", func() {
