diff options
author | Qi Wang <qiwan@redhat.com> | 2019-05-30 17:06:45 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2019-06-03 17:36:34 -0400 |
commit | c1b4060bddabbac63a7b0da1f74bfa8e14f12cab (patch) | |
tree | d4f93e3e97bd49ece09393af1eae63955314f6dc /test/e2e | |
parent | 0ede794da91329ecc5a24c66924ce84023f237f9 (diff) | |
download | podman-c1b4060bddabbac63a7b0da1f74bfa8e14f12cab.tar.gz podman-c1b4060bddabbac63a7b0da1f74bfa8e14f12cab.tar.bz2 podman-c1b4060bddabbac63a7b0da1f74bfa8e14f12cab.zip |
podman copy files to the volume with a container
enabls podman to cpoy files between the host machine and the volume related with a container.
Close #3059
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/cp_test.go | 21 |
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)) + }) }) |