|
1 | 1 | package e2e_test
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "archive/tar" |
5 |
| - "bytes" |
6 | 4 | "fmt"
|
7 | 5 | "io"
|
8 |
| - "io/fs" |
9 | 6 | "net"
|
10 | 7 | "net/http"
|
11 | 8 | "net/url"
|
@@ -262,87 +259,6 @@ var _ = Describe("run basic podman commands", func() {
|
262 | 259 | Expect(run).To(Exit(0))
|
263 | 260 | Expect(build.outputToString()).To(ContainSubstring(name))
|
264 | 261 | })
|
265 |
| - |
266 |
| - It("Copy ops", func() { |
267 |
| - var ( |
268 |
| - stdinDirectory = "stdin-dir" |
269 |
| - stdinFile = "file.txt" |
270 |
| - ) |
271 |
| - |
272 |
| - now := time.Now() |
273 |
| - |
274 |
| - tarBuffer := &bytes.Buffer{} |
275 |
| - tw := tar.NewWriter(tarBuffer) |
276 |
| - |
277 |
| - // Write a directory header to the tar |
278 |
| - err := tw.WriteHeader(&tar.Header{ |
279 |
| - Name: stdinDirectory, |
280 |
| - Mode: int64(0640 | fs.ModeDir), |
281 |
| - Gid: 1000, |
282 |
| - ModTime: now, |
283 |
| - ChangeTime: now, |
284 |
| - AccessTime: now, |
285 |
| - Typeflag: tar.TypeDir, |
286 |
| - }) |
287 |
| - Expect(err).ToNot(HaveOccurred()) |
288 |
| - |
289 |
| - // Write a file header to the tar |
290 |
| - err = tw.WriteHeader(&tar.Header{ |
291 |
| - Name: path.Join(stdinDirectory, stdinFile), |
292 |
| - Mode: 0755, |
293 |
| - Uid: 1000, |
294 |
| - ModTime: now, |
295 |
| - ChangeTime: now, |
296 |
| - AccessTime: now, |
297 |
| - }) |
298 |
| - Expect(err).ToNot(HaveOccurred()) |
299 |
| - |
300 |
| - err = tw.Close() |
301 |
| - Expect(err).ToNot(HaveOccurred()) |
302 |
| - |
303 |
| - name := randomString() |
304 |
| - i := new(initMachine) |
305 |
| - session, err := mb.setName(name).setCmd(i.withImage(mb.imagePath).withNow()).run() |
306 |
| - Expect(err).ToNot(HaveOccurred()) |
307 |
| - Expect(session).To(Exit(0)) |
308 |
| - |
309 |
| - bm := basicMachine{} |
310 |
| - newImgs, err := mb.setCmd(bm.withPodmanCommand([]string{"pull", TESTIMAGE})).run() |
311 |
| - Expect(err).ToNot(HaveOccurred()) |
312 |
| - Expect(newImgs).To(Exit(0)) |
313 |
| - Expect(newImgs.outputToStringSlice()).To(HaveLen(1)) |
314 |
| - |
315 |
| - createAlp, err := mb.setCmd(bm.withPodmanCommand([]string{"create", TESTIMAGE, "top"})).run() |
316 |
| - Expect(err).ToNot(HaveOccurred()) |
317 |
| - Expect(createAlp).To(Exit(0)) |
318 |
| - Expect(createAlp.outputToStringSlice()).To(HaveLen(1)) |
319 |
| - |
320 |
| - // Testing stdin copy with archive mode disabled (ownership will be determined by the tar file) |
321 |
| - containerID := createAlp.outputToStringSlice()[0] |
322 |
| - cpTar, err := mb.setCmd(bm.withPodmanCommand([]string{"cp", "-a=false", "-", containerID + ":/tmp"})).setStdin(tarBuffer).run() |
323 |
| - Expect(err).ToNot(HaveOccurred()) |
324 |
| - Expect(cpTar).To(Exit(0)) |
325 |
| - |
326 |
| - start, err := mb.setCmd(bm.withPodmanCommand([]string{"start", containerID})).run() |
327 |
| - Expect(err).ToNot(HaveOccurred()) |
328 |
| - Expect(start).To(Exit(0)) |
329 |
| - |
330 |
| - // Check the directory is created with the appropriate mode, uid, gid |
331 |
| - exec, err := mb.setCmd(bm.withPodmanCommand([]string{"exec", containerID, "stat", "-c", "%a %u %g", "/tmp/stdin-dir"})).run() |
332 |
| - Expect(err).ToNot(HaveOccurred()) |
333 |
| - Expect(exec).To(Exit(0)) |
334 |
| - execStdOut := exec.outputToStringSlice() |
335 |
| - Expect(execStdOut).To(HaveLen(1)) |
336 |
| - Expect(execStdOut[0]).To(Equal("640 0 1000")) |
337 |
| - |
338 |
| - // Check the file is created with the appropriate mode, uid, gid |
339 |
| - exec, err = mb.setCmd(bm.withPodmanCommand([]string{"exec", containerID, "stat", "-c", "%a %u %g", "/tmp/stdin-dir/file.txt"})).run() |
340 |
| - Expect(err).ToNot(HaveOccurred()) |
341 |
| - Expect(exec).To(Exit(0)) |
342 |
| - execStdOut = exec.outputToStringSlice() |
343 |
| - Expect(execStdOut).To(HaveLen(1)) |
344 |
| - Expect(execStdOut[0]).To(Equal("755 1000 0")) |
345 |
| - }) |
346 | 262 | })
|
347 | 263 |
|
348 | 264 | func testHTTPServer(port string, shouldErr bool, expectedResponse string) {
|
|
0 commit comments