diff options
author | Ed Santiago <santiago@redhat.com> | 2021-08-03 14:09:24 -0600 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-08-10 20:34:11 -0400 |
commit | 04e59f11d05f34c7cbb38cbc4918b69603e1f5e3 (patch) | |
tree | 1f9ba78c6a05f04d730befbf925c1f3e41ea61de /test | |
parent | 870576b39e90cdbc029b116f9f6edecf09f56605 (diff) | |
download | podman-04e59f11d05f34c7cbb38cbc4918b69603e1f5e3.tar.gz podman-04e59f11d05f34c7cbb38cbc4918b69603e1f5e3.tar.bz2 podman-04e59f11d05f34c7cbb38cbc4918b69603e1f5e3.zip |
podman info: try qfile before equery
podman info takes >20s on Gentoo, because equery is s..l..o..w.
qfile is much faster and, I suspect, present in most Gentoo
installations, so let's try it first.
And, because packageVersion() was scarily unmaintainable,
refactor it. Define a simple (string) list of packaging tools
to query (rpm, dpkg, ...) and iterate until we find one that
works.
IMPORTANT NOTE: the Debian (and, presumably, Ubuntu) query does not
include version number! There is no standard way on Debian to get
a package version from a file path, you can only do it via pipes
of chained commands, and I have no desire to implement that.
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/005-info.bats | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 4b419841e..50c3ceb30 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -33,12 +33,16 @@ cgroupVersion: v[12] expr_nvr="[a-z0-9-]\\\+-[a-z0-9.]\\\+-[a-z0-9]\\\+\." expr_path="/[a-z0-9\\\/.-]\\\+\\\$" + # FIXME: if we're ever able to get package versions on Debian, + # add '-[0-9]' to all '*.package' queries below. tests=" host.buildahVersion | [0-9.] host.conmon.path | $expr_path +host.conmon.package | .*conmon.* host.cgroupManager | \\\(systemd\\\|cgroupfs\\\) host.cgroupVersion | v[12] host.ociRuntime.path | $expr_path +host.ociRuntime.package | .*\\\(crun\\\|runc\\\).* store.configFile | $expr_path store.graphDriverName | [a-z0-9]\\\+\\\$ store.graphRoot | $expr_path |