Skip to content

Commit 9464512

Browse files
committed
WIP: tests: add tests for PodmanSystemInfo, PodmanPs
1 parent dceb4df commit 9464512

File tree

3 files changed

+378
-0
lines changed

3 files changed

+378
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"command": "podman ps --format=json --all",
3+
"requires_command": "podman",
4+
"output": [
5+
"[]"
6+
],
7+
"fact": []
8+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"command": "podman ps --format=json --all",
3+
"requires_command": "podman",
4+
"output": [
5+
"[",
6+
" {",
7+
" \"AutoRemove\": true,",
8+
" \"Command\": [",
9+
" \"bash\"",
10+
" ],",
11+
" \"CreatedAt\": \"3 seconds ago\",",
12+
" \"Exited\": false,",
13+
" \"ExitedAt\": -62135596800,",
14+
" \"ExitCode\": 0,",
15+
" \"Id\": \"a0319f34c9948123e217e0d145f35ad4903517f96d7c096145169dc70ed6badf\",",
16+
" \"Image\": \"docker.io/library/debian:unstable\",",
17+
" \"ImageID\": \"e1234e51d050c2c0e7d2517cc5d6e6db6b91de08124e56246bdd8acd01f4af92\",",
18+
" \"IsInfra\": false,",
19+
" \"Labels\": null,",
20+
" \"Mounts\": [],",
21+
" \"Names\": [",
22+
" \"blissful_cerf\"",
23+
" ],",
24+
" \"Namespaces\": {",
25+
" ",
26+
" },",
27+
" \"Networks\": [],",
28+
" \"Pid\": 74195,",
29+
" \"Pod\": \"\",",
30+
" \"PodName\": \"\",",
31+
" \"Ports\": null,",
32+
" \"Size\": null,",
33+
" \"StartedAt\": 1730384087,",
34+
" \"State\": \"running\",",
35+
" \"Status\": \"Up 3 seconds ago\",",
36+
" \"Created\": 1730384086",
37+
" }",
38+
"]"
39+
],
40+
"fact": [
41+
{
42+
"AutoRemove": true,
43+
"Command": [
44+
"bash"
45+
],
46+
"CreatedAt": "3 seconds ago",
47+
"Exited": false,
48+
"ExitedAt": -62135596800,
49+
"ExitCode": 0,
50+
"Id": "a0319f34c9948123e217e0d145f35ad4903517f96d7c096145169dc70ed6badf",
51+
"Image": "docker.io/library/debian:unstable",
52+
"ImageID": "e1234e51d050c2c0e7d2517cc5d6e6db6b91de08124e56246bdd8acd01f4af92",
53+
"IsInfra": false,
54+
"Labels": null,
55+
"Mounts": [],
56+
"Names": [
57+
"blissful_cerf"
58+
],
59+
"Namespaces": {
60+
61+
},
62+
"Networks": [],
63+
"Pid": 74195,
64+
"Pod": "",
65+
"PodName": "",
66+
"Ports": null,
67+
"Size": null,
68+
"StartedAt": 1730384087,
69+
"State": "running",
70+
"Status": "Up 3 seconds ago",
71+
"Created": 1730384086
72+
}
73+
]
74+
}
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
{
2+
"command": "podman system info --format=json",
3+
"requires_command": "podman",
4+
"output": [
5+
"{",
6+
" \"host\": {",
7+
" \"arch\": \"amd64\",",
8+
" \"buildahVersion\": \"1.28.2\",",
9+
" \"cgroupManager\": \"systemd\",",
10+
" \"cgroupVersion\": \"v2\",",
11+
" \"cgroupControllers\": [",
12+
" \"cpu\",",
13+
" \"memory\",",
14+
" \"pids\"",
15+
" ],",
16+
" \"conmon\": {",
17+
" \"package\": \"conmon_2.1.6+ds1-1_amd64\",",
18+
" \"path\": \"/usr/bin/conmon\",",
19+
" \"version\": \"conmon version 2.1.6, commit: unknown\"",
20+
" },",
21+
" \"cpus\": 6,",
22+
" \"cpuUtilization\": {",
23+
" \"userPercent\": 4.87,",
24+
" \"systemPercent\": 5.66,",
25+
" \"idlePercent\": 89.47",
26+
" },",
27+
" \"distribution\": {",
28+
" \"distribution\": \"debian\",",
29+
" \"version\": \"12\",",
30+
" \"codename\": \"bookworm\"",
31+
" },",
32+
" \"eventLogger\": \"journald\",",
33+
" \"hostname\": \"mcc011\",",
34+
" \"idMappings\": {",
35+
" \"gidmap\": [",
36+
" {",
37+
" \"container_id\": 0,",
38+
" \"host_id\": 1000,",
39+
" \"size\": 1",
40+
" },",
41+
" {",
42+
" \"container_id\": 1,",
43+
" \"host_id\": 100000,",
44+
" \"size\": 65536",
45+
" }",
46+
" ],",
47+
" \"uidmap\": [",
48+
" {",
49+
" \"container_id\": 0,",
50+
" \"host_id\": 1000,",
51+
" \"size\": 1",
52+
" },",
53+
" {",
54+
" \"container_id\": 1,",
55+
" \"host_id\": 100000,",
56+
" \"size\": 65536",
57+
" }",
58+
" ]",
59+
" },",
60+
" \"kernel\": \"6.1.0-26-amd64\",",
61+
" \"logDriver\": \"journald\",",
62+
" \"memFree\": 11634356224,",
63+
" \"memTotal\": 16606085120,",
64+
" \"networkBackend\": \"cni\",",
65+
" \"ociRuntime\": {",
66+
" \"name\": \"crun\",",
67+
" \"package\": \"crun_1.8.1-1+deb12u1_amd64\",",
68+
" \"path\": \"/usr/bin/crun\",",
69+
" \"version\": \"crun version 1.8.1\\ncommit: f8a096be060b22ccd3d5f3ebe44108517fbf6c30\\nrundir: /run/user/1000/crun\\nspec: 1.0.0\\n+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL\"",
70+
" },",
71+
" \"os\": \"linux\",",
72+
" \"remoteSocket\": {",
73+
" \"path\": \"/run/user/1000/podman/podman.sock\"",
74+
" },",
75+
" \"serviceIsRemote\": false,",
76+
" \"security\": {",
77+
" \"apparmorEnabled\": false,",
78+
" \"capabilities\": \"CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT\",",
79+
" \"rootless\": true,",
80+
" \"seccompEnabled\": true,",
81+
" \"seccompProfilePath\": \"/usr/share/containers/seccomp.json\",",
82+
" \"selinuxEnabled\": false",
83+
" },",
84+
" \"slirp4netns\": {",
85+
" \"executable\": \"/usr/bin/slirp4netns\",",
86+
" \"package\": \"slirp4netns_1.2.0-1_amd64\",",
87+
" \"version\": \"slirp4netns version 1.2.0\\ncommit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383\\nlibslirp: 4.7.0\\nSLIRP_CONFIG_VERSION_MAX: 4\\nlibseccomp: 2.5.4\"",
88+
" },",
89+
" \"swapFree\": 7998533632,",
90+
" \"swapTotal\": 7998533632,",
91+
" \"uptime\": \"502h 36m 25.00s (Approximately 20.92 days)\",",
92+
" \"linkmode\": \"dynamic\"",
93+
" },",
94+
" \"store\": {",
95+
" \"configFile\": \"/home/sysadmin/.config/containers/storage.conf\",",
96+
" \"containerStore\": {",
97+
" \"number\": 0,",
98+
" \"paused\": 0,",
99+
" \"running\": 0,",
100+
" \"stopped\": 0",
101+
" },",
102+
" \"graphDriverName\": \"vfs\",",
103+
" \"graphOptions\": {",
104+
" ",
105+
" },",
106+
" \"graphRoot\": \"/home/sysadmin/.local/share/containers/storage\",",
107+
" \"graphRootAllocated\": 116060811264,",
108+
" \"graphRootUsed\": 11818217472,",
109+
" \"graphStatus\": {",
110+
" ",
111+
" },",
112+
" \"imageCopyTmpDir\": \"/var/tmp\",",
113+
" \"imageStore\": {",
114+
" \"number\": 0",
115+
" },",
116+
" \"runRoot\": \"/run/user/1000/containers\",",
117+
" \"volumePath\": \"/home/sysadmin/.local/share/containers/storage/volumes\"",
118+
" },",
119+
" \"registries\": {",
120+
" ",
121+
" },",
122+
" \"plugins\": {",
123+
" \"volume\": [",
124+
" \"local\"",
125+
" ],",
126+
" \"network\": [",
127+
" \"bridge\",",
128+
" \"macvlan\",",
129+
" \"ipvlan\"",
130+
" ],",
131+
" \"log\": [",
132+
" \"k8s-file\",",
133+
" \"none\",",
134+
" \"passthrough\",",
135+
" \"journald\"",
136+
" ],",
137+
" \"authorization\": null",
138+
" },",
139+
" \"version\": {",
140+
" \"APIVersion\": \"4.3.1\",",
141+
" \"Version\": \"4.3.1\",",
142+
" \"GoVersion\": \"go1.19.8\",",
143+
" \"GitCommit\": \"\",",
144+
" \"BuiltTime\": \"Thu Jan 1 01:00:00 1970\",",
145+
" \"Built\": 0,",
146+
" \"OsArch\": \"linux/amd64\",",
147+
" \"Os\": \"linux\"",
148+
" }",
149+
"}"
150+
],
151+
"fact": {
152+
"host": {
153+
"arch": "amd64",
154+
"buildahVersion": "1.28.2",
155+
"cgroupManager": "systemd",
156+
"cgroupVersion": "v2",
157+
"cgroupControllers": [
158+
"cpu",
159+
"memory",
160+
"pids"
161+
],
162+
"conmon": {
163+
"package": "conmon_2.1.6+ds1-1_amd64",
164+
"path": "/usr/bin/conmon",
165+
"version": "conmon version 2.1.6, commit: unknown"
166+
},
167+
"cpus": 6,
168+
"cpuUtilization": {
169+
"userPercent": 4.87,
170+
"systemPercent": 5.66,
171+
"idlePercent": 89.47
172+
},
173+
"distribution": {
174+
"distribution": "debian",
175+
"version": "12",
176+
"codename": "bookworm"
177+
},
178+
"eventLogger": "journald",
179+
"hostname": "mcc011",
180+
"idMappings": {
181+
"gidmap": [
182+
{
183+
"container_id": 0,
184+
"host_id": 1000,
185+
"size": 1
186+
},
187+
{
188+
"container_id": 1,
189+
"host_id": 100000,
190+
"size": 65536
191+
}
192+
],
193+
"uidmap": [
194+
{
195+
"container_id": 0,
196+
"host_id": 1000,
197+
"size": 1
198+
},
199+
{
200+
"container_id": 1,
201+
"host_id": 100000,
202+
"size": 65536
203+
}
204+
]
205+
},
206+
"kernel": "6.1.0-26-amd64",
207+
"logDriver": "journald",
208+
"memFree": 11634356224,
209+
"memTotal": 16606085120,
210+
"networkBackend": "cni",
211+
"ociRuntime": {
212+
"name": "crun",
213+
"package": "crun_1.8.1-1+deb12u1_amd64",
214+
"path": "/usr/bin/crun",
215+
"version": "crun version 1.8.1\ncommit: f8a096be060b22ccd3d5f3ebe44108517fbf6c30\nrundir: /run/user/1000/crun\nspec: 1.0.0\n+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL"
216+
},
217+
"os": "linux",
218+
"remoteSocket": {
219+
"path": "/run/user/1000/podman/podman.sock"
220+
},
221+
"serviceIsRemote": false,
222+
"security": {
223+
"apparmorEnabled": false,
224+
"capabilities": "CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT",
225+
"rootless": true,
226+
"seccompEnabled": true,
227+
"seccompProfilePath": "/usr/share/containers/seccomp.json",
228+
"selinuxEnabled": false
229+
},
230+
"slirp4netns": {
231+
"executable": "/usr/bin/slirp4netns",
232+
"package": "slirp4netns_1.2.0-1_amd64",
233+
"version": "slirp4netns version 1.2.0\ncommit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383\nlibslirp: 4.7.0\nSLIRP_CONFIG_VERSION_MAX: 4\nlibseccomp: 2.5.4"
234+
},
235+
"swapFree": 7998533632,
236+
"swapTotal": 7998533632,
237+
"uptime": "502h 36m 25.00s (Approximately 20.92 days)",
238+
"linkmode": "dynamic"
239+
},
240+
"store": {
241+
"configFile": "/home/sysadmin/.config/containers/storage.conf",
242+
"containerStore": {
243+
"number": 0,
244+
"paused": 0,
245+
"running": 0,
246+
"stopped": 0
247+
},
248+
"graphDriverName": "vfs",
249+
"graphOptions": {
250+
251+
},
252+
"graphRoot": "/home/sysadmin/.local/share/containers/storage",
253+
"graphRootAllocated": 116060811264,
254+
"graphRootUsed": 11818217472,
255+
"graphStatus": {
256+
257+
},
258+
"imageCopyTmpDir": "/var/tmp",
259+
"imageStore": {
260+
"number": 0
261+
},
262+
"runRoot": "/run/user/1000/containers",
263+
"volumePath": "/home/sysadmin/.local/share/containers/storage/volumes"
264+
},
265+
"registries": {
266+
267+
},
268+
"plugins": {
269+
"volume": [
270+
"local"
271+
],
272+
"network": [
273+
"bridge",
274+
"macvlan",
275+
"ipvlan"
276+
],
277+
"log": [
278+
"k8s-file",
279+
"none",
280+
"passthrough",
281+
"journald"
282+
],
283+
"authorization": null
284+
},
285+
"version": {
286+
"APIVersion": "4.3.1",
287+
"Version": "4.3.1",
288+
"GoVersion": "go1.19.8",
289+
"GitCommit": "",
290+
"BuiltTime": "Thu Jan 1 01:00:00 1970",
291+
"Built": 0,
292+
"OsArch": "linux/amd64",
293+
"Os": "linux"
294+
}
295+
}
296+
}

0 commit comments

Comments
 (0)