Skip to content

Commit

Permalink
tests: add tests for PodmanSystemInfo, PodmanPs
Browse files Browse the repository at this point in the history
  • Loading branch information
bauen1 authored and Fizzadar committed Jan 4, 2025
1 parent c2b9c83 commit dcc817c
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/facts/podman.PodmanPs/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"command": "podman ps --format=json --all",
"requires_command": "podman",
"output": [
"[]"
],
"fact": []
}
74 changes: 74 additions & 0 deletions tests/facts/podman.PodmanPs/onecontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"command": "podman ps --format=json --all",
"requires_command": "podman",
"output": [
"[",
" {",
" \"AutoRemove\": true,",
" \"Command\": [",
" \"bash\"",
" ],",
" \"CreatedAt\": \"3 seconds ago\",",
" \"Exited\": false,",
" \"ExitedAt\": -62135596800,",
" \"ExitCode\": 0,",
" \"Id\": \"a0319f34c9948123e217e0d145f35ad4903517f96d7c096145169dc70ed6badf\",",
" \"Image\": \"docker.io/library/debian:unstable\",",
" \"ImageID\": \"e1234e51d050c2c0e7d2517cc5d6e6db6b91de08124e56246bdd8acd01f4af92\",",
" \"IsInfra\": false,",
" \"Labels\": null,",
" \"Mounts\": [],",
" \"Names\": [",
" \"blissful_cerf\"",
" ],",
" \"Namespaces\": {",
" ",
" },",
" \"Networks\": [],",
" \"Pid\": 74195,",
" \"Pod\": \"\",",
" \"PodName\": \"\",",
" \"Ports\": null,",
" \"Size\": null,",
" \"StartedAt\": 1730384087,",
" \"State\": \"running\",",
" \"Status\": \"Up 3 seconds ago\",",
" \"Created\": 1730384086",
" }",
"]"
],
"fact": [
{
"AutoRemove": true,
"Command": [
"bash"
],
"CreatedAt": "3 seconds ago",
"Exited": false,
"ExitedAt": -62135596800,
"ExitCode": 0,
"Id": "a0319f34c9948123e217e0d145f35ad4903517f96d7c096145169dc70ed6badf",
"Image": "docker.io/library/debian:unstable",
"ImageID": "e1234e51d050c2c0e7d2517cc5d6e6db6b91de08124e56246bdd8acd01f4af92",
"IsInfra": false,
"Labels": null,
"Mounts": [],
"Names": [
"blissful_cerf"
],
"Namespaces": {

},
"Networks": [],
"Pid": 74195,
"Pod": "",
"PodName": "",
"Ports": null,
"Size": null,
"StartedAt": 1730384087,
"State": "running",
"Status": "Up 3 seconds ago",
"Created": 1730384086
}
]
}
296 changes: 296 additions & 0 deletions tests/facts/podman.PodmanSystemInfo/info1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
{
"command": "podman system info --format=json",
"requires_command": "podman",
"output": [
"{",
" \"host\": {",
" \"arch\": \"amd64\",",
" \"buildahVersion\": \"1.28.2\",",
" \"cgroupManager\": \"systemd\",",
" \"cgroupVersion\": \"v2\",",
" \"cgroupControllers\": [",
" \"cpu\",",
" \"memory\",",
" \"pids\"",
" ],",
" \"conmon\": {",
" \"package\": \"conmon_2.1.6+ds1-1_amd64\",",
" \"path\": \"/usr/bin/conmon\",",
" \"version\": \"conmon version 2.1.6, commit: unknown\"",
" },",
" \"cpus\": 6,",
" \"cpuUtilization\": {",
" \"userPercent\": 4.87,",
" \"systemPercent\": 5.66,",
" \"idlePercent\": 89.47",
" },",
" \"distribution\": {",
" \"distribution\": \"debian\",",
" \"version\": \"12\",",
" \"codename\": \"bookworm\"",
" },",
" \"eventLogger\": \"journald\",",
" \"hostname\": \"mcc011\",",
" \"idMappings\": {",
" \"gidmap\": [",
" {",
" \"container_id\": 0,",
" \"host_id\": 1000,",
" \"size\": 1",
" },",
" {",
" \"container_id\": 1,",
" \"host_id\": 100000,",
" \"size\": 65536",
" }",
" ],",
" \"uidmap\": [",
" {",
" \"container_id\": 0,",
" \"host_id\": 1000,",
" \"size\": 1",
" },",
" {",
" \"container_id\": 1,",
" \"host_id\": 100000,",
" \"size\": 65536",
" }",
" ]",
" },",
" \"kernel\": \"6.1.0-26-amd64\",",
" \"logDriver\": \"journald\",",
" \"memFree\": 11634356224,",
" \"memTotal\": 16606085120,",
" \"networkBackend\": \"cni\",",
" \"ociRuntime\": {",
" \"name\": \"crun\",",
" \"package\": \"crun_1.8.1-1+deb12u1_amd64\",",
" \"path\": \"/usr/bin/crun\",",
" \"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\"",
" },",
" \"os\": \"linux\",",
" \"remoteSocket\": {",
" \"path\": \"/run/user/1000/podman/podman.sock\"",
" },",
" \"serviceIsRemote\": false,",
" \"security\": {",
" \"apparmorEnabled\": false,",
" \"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\",",
" \"rootless\": true,",
" \"seccompEnabled\": true,",
" \"seccompProfilePath\": \"/usr/share/containers/seccomp.json\",",
" \"selinuxEnabled\": false",
" },",
" \"slirp4netns\": {",
" \"executable\": \"/usr/bin/slirp4netns\",",
" \"package\": \"slirp4netns_1.2.0-1_amd64\",",
" \"version\": \"slirp4netns version 1.2.0\\ncommit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383\\nlibslirp: 4.7.0\\nSLIRP_CONFIG_VERSION_MAX: 4\\nlibseccomp: 2.5.4\"",
" },",
" \"swapFree\": 7998533632,",
" \"swapTotal\": 7998533632,",
" \"uptime\": \"502h 36m 25.00s (Approximately 20.92 days)\",",
" \"linkmode\": \"dynamic\"",
" },",
" \"store\": {",
" \"configFile\": \"/home/sysadmin/.config/containers/storage.conf\",",
" \"containerStore\": {",
" \"number\": 0,",
" \"paused\": 0,",
" \"running\": 0,",
" \"stopped\": 0",
" },",
" \"graphDriverName\": \"vfs\",",
" \"graphOptions\": {",
" ",
" },",
" \"graphRoot\": \"/home/sysadmin/.local/share/containers/storage\",",
" \"graphRootAllocated\": 116060811264,",
" \"graphRootUsed\": 11818217472,",
" \"graphStatus\": {",
" ",
" },",
" \"imageCopyTmpDir\": \"/var/tmp\",",
" \"imageStore\": {",
" \"number\": 0",
" },",
" \"runRoot\": \"/run/user/1000/containers\",",
" \"volumePath\": \"/home/sysadmin/.local/share/containers/storage/volumes\"",
" },",
" \"registries\": {",
" ",
" },",
" \"plugins\": {",
" \"volume\": [",
" \"local\"",
" ],",
" \"network\": [",
" \"bridge\",",
" \"macvlan\",",
" \"ipvlan\"",
" ],",
" \"log\": [",
" \"k8s-file\",",
" \"none\",",
" \"passthrough\",",
" \"journald\"",
" ],",
" \"authorization\": null",
" },",
" \"version\": {",
" \"APIVersion\": \"4.3.1\",",
" \"Version\": \"4.3.1\",",
" \"GoVersion\": \"go1.19.8\",",
" \"GitCommit\": \"\",",
" \"BuiltTime\": \"Thu Jan 1 01:00:00 1970\",",
" \"Built\": 0,",
" \"OsArch\": \"linux/amd64\",",
" \"Os\": \"linux\"",
" }",
"}"
],
"fact": {
"host": {
"arch": "amd64",
"buildahVersion": "1.28.2",
"cgroupManager": "systemd",
"cgroupVersion": "v2",
"cgroupControllers": [
"cpu",
"memory",
"pids"
],
"conmon": {
"package": "conmon_2.1.6+ds1-1_amd64",
"path": "/usr/bin/conmon",
"version": "conmon version 2.1.6, commit: unknown"
},
"cpus": 6,
"cpuUtilization": {
"userPercent": 4.87,
"systemPercent": 5.66,
"idlePercent": 89.47
},
"distribution": {
"distribution": "debian",
"version": "12",
"codename": "bookworm"
},
"eventLogger": "journald",
"hostname": "mcc011",
"idMappings": {
"gidmap": [
{
"container_id": 0,
"host_id": 1000,
"size": 1
},
{
"container_id": 1,
"host_id": 100000,
"size": 65536
}
],
"uidmap": [
{
"container_id": 0,
"host_id": 1000,
"size": 1
},
{
"container_id": 1,
"host_id": 100000,
"size": 65536
}
]
},
"kernel": "6.1.0-26-amd64",
"logDriver": "journald",
"memFree": 11634356224,
"memTotal": 16606085120,
"networkBackend": "cni",
"ociRuntime": {
"name": "crun",
"package": "crun_1.8.1-1+deb12u1_amd64",
"path": "/usr/bin/crun",
"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"
},
"os": "linux",
"remoteSocket": {
"path": "/run/user/1000/podman/podman.sock"
},
"serviceIsRemote": false,
"security": {
"apparmorEnabled": false,
"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",
"rootless": true,
"seccompEnabled": true,
"seccompProfilePath": "/usr/share/containers/seccomp.json",
"selinuxEnabled": false
},
"slirp4netns": {
"executable": "/usr/bin/slirp4netns",
"package": "slirp4netns_1.2.0-1_amd64",
"version": "slirp4netns version 1.2.0\ncommit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383\nlibslirp: 4.7.0\nSLIRP_CONFIG_VERSION_MAX: 4\nlibseccomp: 2.5.4"
},
"swapFree": 7998533632,
"swapTotal": 7998533632,
"uptime": "502h 36m 25.00s (Approximately 20.92 days)",
"linkmode": "dynamic"
},
"store": {
"configFile": "/home/sysadmin/.config/containers/storage.conf",
"containerStore": {
"number": 0,
"paused": 0,
"running": 0,
"stopped": 0
},
"graphDriverName": "vfs",
"graphOptions": {

},
"graphRoot": "/home/sysadmin/.local/share/containers/storage",
"graphRootAllocated": 116060811264,
"graphRootUsed": 11818217472,
"graphStatus": {

},
"imageCopyTmpDir": "/var/tmp",
"imageStore": {
"number": 0
},
"runRoot": "/run/user/1000/containers",
"volumePath": "/home/sysadmin/.local/share/containers/storage/volumes"
},
"registries": {

},
"plugins": {
"volume": [
"local"
],
"network": [
"bridge",
"macvlan",
"ipvlan"
],
"log": [
"k8s-file",
"none",
"passthrough",
"journald"
],
"authorization": null
},
"version": {
"APIVersion": "4.3.1",
"Version": "4.3.1",
"GoVersion": "go1.19.8",
"GitCommit": "",
"BuiltTime": "Thu Jan 1 01:00:00 1970",
"Built": 0,
"OsArch": "linux/amd64",
"Os": "linux"
}
}
}

0 comments on commit dcc817c

Please sign in to comment.