aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-15 11:53:59 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-06 12:45:42 -0500
commite20ecc733c878f0c4b67a21204f0d5ae11929bf0 (patch)
tree8686fd9c9f123cbed11f0589655caaa128b12061 /test
parente318b09b6800ddb013ddf3b9a2fb99ebc55bd920 (diff)
downloadpodman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.tar.gz
podman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.tar.bz2
podman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.zip
refactor info
the current implementation of info, while typed, is very loosely done so. we need stronger types for our apiv2 implmentation and bindings. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/info_test.go8
-rw-r--r--test/system/005-info.bats32
-rw-r--r--test/system/030-run.bats2
-rw-r--r--test/system/065-cp.bats2
-rw-r--r--test/system/400-unprivileged-access.bats4
-rw-r--r--test/system/helpers.bash2
6 files changed, 28 insertions, 22 deletions
diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go
index d16661d5b..446dbc16e 100644
--- a/test/e2e/info_test.go
+++ b/test/e2e/info_test.go
@@ -43,10 +43,16 @@ var _ = Describe("Podman Info", func() {
Expect(session.ExitCode()).To(Equal(0))
})
- It("podman info --format GO template", func() {
+ It("podman info --format JSON GO template", func() {
session := podmanTest.Podman([]string{"info", "--format", "{{ json .}}"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.IsJSONOutputValid()).To(BeTrue())
})
+
+ It("podman info --format GO template", func() {
+ session := podmanTest.Podman([]string{"info", "--format", "{{ .Store.GraphRoot }}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index f229b0886..c53ba8125 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -8,19 +8,19 @@ load helpers
run_podman info
expected_keys="
-BuildahVersion: *[0-9.]\\\+
-Conmon:\\\s\\\+package:
-Distribution:
-OCIRuntime:\\\s\\\+name:
+buildahVersion: *[0-9.]\\\+
+conmon:\\\s\\\+package:
+distribution:
+ociRuntime:\\\s\\\+name:
os:
rootless:
registries:
store:
-GraphDriverName:
-GraphRoot:
-GraphStatus:
-ImageStore:\\\s\\\+number: 1
-RunRoot:
+graphDriverName:
+graphRoot:
+graphStatus:
+imageStore:\\\s\\\+number: 1
+runRoot:
"
while read expect; do
is "$output" ".*$expect" "output includes '$expect'"
@@ -36,13 +36,13 @@ RunRoot:
expr_path="/[a-z0-9\\\/.-]\\\+\\\$"
tests="
-host.BuildahVersion | [0-9.]
-host.Conmon.path | $expr_path
-host.OCIRuntime.path | $expr_path
-store.ConfigFile | $expr_path
-store.GraphDriverName | [a-z0-9]\\\+\\\$
-store.GraphRoot | $expr_path
-store.ImageStore.number | 1
+host.buildahVersion | [0-9.]
+host.conmon.path | $expr_path
+host.ociRuntime.path | $expr_path
+store.configFile | $expr_path
+store.graphDriverName | [a-z0-9]\\\+\\\$
+store.graphRoot | $expr_path
+store.imageStore.number | 1
"
parse_table "$tests" | while read field expect; do
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 98c65f788..56e9fed3b 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -12,7 +12,7 @@ load helpers
err_no_exec_dir="Error: .*: starting container process caused .*exec:.* permission denied"
# ...but check the configured runtime engine, and switch to crun as needed
- run_podman info --format '{{ .host.OCIRuntime.path }}'
+ run_podman info --format '{{ .Host.OCIRuntime.Path }}'
if expr "$output" : ".*/crun"; then
err_no_such_cmd="Error: executable file not found in \$PATH: No such file or directory: OCI runtime command not found error"
err_no_exec_dir="Error: open executable: Operation not permitted: OCI runtime permission denied error"
diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats
index 0701055f9..a350c2173 100644
--- a/test/system/065-cp.bats
+++ b/test/system/065-cp.bats
@@ -187,7 +187,7 @@ load helpers
chmod 644 $srcdir/$rand_filename
# Determine path to podman storage (eg /var/lib/c/s, or $HOME/.local/...)
- run_podman info --format '{{.store.GraphRoot}}'
+ run_podman info --format '{{.Store.GraphRoot}}'
graphroot=$output
# Create that directory in the container, and sleep (to keep container
diff --git a/test/system/400-unprivileged-access.bats b/test/system/400-unprivileged-access.bats
index 56c40e9c8..98f8b8211 100644
--- a/test/system/400-unprivileged-access.bats
+++ b/test/system/400-unprivileged-access.bats
@@ -70,10 +70,10 @@ EOF
chmod 755 $PODMAN_TMPDIR $test_script
# get podman image and container storage directories
- run_podman info --format '{{.store.GraphRoot}}'
+ run_podman info --format '{{.Store.GraphRoot}}'
is "$output" "/var/lib/containers/storage" "GraphRoot in expected place"
GRAPH_ROOT="$output"
- run_podman info --format '{{.store.RunRoot}}'
+ run_podman info --format '{{.Store.RunRoot}}'
is "$output" "/var/run/containers/storage" "RunRoot in expected place"
RUN_ROOT="$output"
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 2e856930e..51240edc9 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -391,7 +391,7 @@ function random_string() {
# Return exec_pid hash files if exists, otherwise, return nothing
#
function find_exec_pid_files() {
- run_podman info --format '{{.store.RunRoot}}'
+ run_podman info --format '{{.Store.RunRoot}}'
local storage_path="$output"
if [ -d $storage_path ]; then
find $storage_path -type f -iname 'exec_pid_*'