Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf88409e

Browse files
committed
Fixes#27260 Add e2e test for Podman artifact events
Signed-off-by: ByoungUk Lee <nimdrak@gmail.com>
1 parentd2faab0 commitf88409e

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

‎test/e2e/events_test.go‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ package integration
55
import (
66
"encoding/json"
77
"fmt"
8+
"sort"
89
"strconv"
10+
"strings"
911
"sync"
1012
"time"
1113

@@ -27,6 +29,8 @@ var _ = Describe("Podman events", func() {
2729
_,ec,_:=podmanTest.RunLsContainer("")
2830
Expect(ec).To(Equal(0))
2931
result:=podmanTest.Podman([]string{"events","--stream=false"})
32+
fmt.Println("test")
33+
fmt.Println(result)
3034
result.WaitWithDefaultTimeout()
3135
Expect(result).Should(ExitCleanly())
3236
})
@@ -309,4 +313,52 @@ var _ = Describe("Podman events", func() {
309313
Expect(result.OutputToStringArray()).ToNot(BeEmpty(),"Number of health_status events")
310314
})
311315

316+
It("podman events artifacts",func() {
317+
lock,port,err:=setupRegistry(nil)
318+
Expect(err).ToNot(HaveOccurred())
319+
deferlock.Unlock()
320+
321+
artifactFile,err:=createArtifactFile(4192)
322+
Expect(err).ToNot(HaveOccurred())
323+
artifactName:=fmt.Sprintf("localhost:%s/test/artifact1",port)
324+
325+
podmanTest.PodmanExitCleanly("artifact","add",artifactName,artifactFile)
326+
327+
podmanTest.PodmanExitCleanly("artifact","extract",artifactName,artifactFile)
328+
329+
podmanTest.PodmanExitCleanly("artifact","push","-q","--tls-verify=false",artifactName)
330+
331+
podmanTest.PodmanExitCleanly("artifact","remove",artifactName)
332+
333+
podmanTest.PodmanExitCleanly("artifact","pull","--tls-verify=false",artifactName)
334+
335+
result:=podmanTest.PodmanExitCleanly("events","--stream=false","--filter","type=artifact")
336+
events:=result.OutputToStringArray()
337+
338+
// sort for remote
339+
sort.Slice(events,func(i,jint)bool {
340+
getStatus:=func(logstring)string {
341+
status:=strings.Fields(log)
342+
returnstatus[5]
343+
}
344+
returngetStatus(events[i])<getStatus(events[j])
345+
})
346+
347+
Expect(events).To(HaveLen(5))
348+
Expect(events[0]).To(And(
349+
ContainSubstring("artifact add"),
350+
ContainSubstring(fmt.Sprintf("(name=%s, files=%s)",artifactName,"1"))))
351+
Expect(events[1]).To(And(
352+
ContainSubstring("artifact extract"),
353+
ContainSubstring(fmt.Sprintf("(name=%s, target=%s)",artifactName,artifactFile))))
354+
Expect(events[2]).To(And(
355+
ContainSubstring("artifact pull"),
356+
ContainSubstring(fmt.Sprintf("(name=%s)",artifactName))))
357+
Expect(events[3]).To(And(
358+
ContainSubstring("artifact push"),
359+
ContainSubstring(fmt.Sprintf("(name=%s)",artifactName))))
360+
Expect(events[4]).To(And(
361+
ContainSubstring("artifact remove"),
362+
ContainSubstring(fmt.Sprintf("(name=%s)",artifactName))))
363+
})
312364
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp