summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-15 12:48:54 +0200
committerGitHub <noreply@github.com>2019-06-15 12:48:54 +0200
commit670fc030886938b4ee93aa2ddd5db6c947bd975a (patch)
tree98828b05eab36a8087d08c35ce577f3169699fc9 /test
parentb82c4e938458eaa0b9fd1b90a586541d87bffc93 (diff)
parentc1b4060bddabbac63a7b0da1f74bfa8e14f12cab (diff)
downloadpodman-670fc030886938b4ee93aa2ddd5db6c947bd975a.tar.gz
podman-670fc030886938b4ee93aa2ddd5db6c947bd975a.tar.bz2
podman-670fc030886938b4ee93aa2ddd5db6c947bd975a.zip
Merge pull request #3094 from QiWang19/cpvol
podman copy files to the volume with a container
Diffstat (limited to 'test')
-rw-r--r--test/e2e/cp_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index 597d0aef7..f7596d77d 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -184,4 +184,25 @@ var _ = Describe("Podman cp", func() {
_, err = os.Stat("/tmp/cp_test.txt")
Expect(err).To(Not(BeNil()))
})
+ It("podman cp volume", func() {
+ session := podmanTest.Podman([]string{"volume", "create", "data"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"create", "-v", "data:/data", "--name", "container1", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ err = ioutil.WriteFile("cp_vol", []byte("copy to the volume"), 0644)
+ if err != nil {
+ os.Exit(1)
+ }
+ session = podmanTest.Podman([]string{"cp", "cp_vol", "container1" + ":/data/cp_vol1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", "container1" + ":/data/cp_vol1", "cp_vol2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})