-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if QM is installed #532
Conversation
Signed-off-by: nsednev <[email protected]>
@@ -261,13 +261,15 @@ fi | |||
echo | |||
info_message "Checking if QM already installed" | |||
info_message "==============================" | |||
QM_INST="$(rpm -qa qm)" | |||
QM_STATUS="$(systemctl is-enabled qm 2>&1)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When qm
is not installed in the environment, error will occur when running to this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to add only an error message here or also to exit the tool if the QM is not installed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When qm is not installed, set-ffi-env-e2e
should run to install it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rpm -qa will provide details of package which may not what we want in this case, let's go simple, just use -q.
How about, test the following:
# Check if qm package is installed
if rpm -q qm &>/dev/null; then
# Check the status of the qm service
QM_STATUS="$(systemctl is-enabled qm 2>&1)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the VM without QM, running auto-osbuild-qemu-autosd9-minimal-ostree-x86_64-1437090712.02176fac image.
Tried to run one of my tests that requires set-ffi-env-e2e and I saw that its fine now:
First I validated that on the tested VM there is no QM installed:
[root@localhost ~]# rpm -q qm
package qm is not installed
As the result, there was no podman package as well on the DUT (device under test).
Then I ran one of the tests using tmt before suggested change (with current patch):
tmt run -a -vvv --debug execute provision --how connect -u root -g tests --name qm_nested
multihost name: default-0
arch: x86_64
distro: Automotive Stream Distribution 9
kernel: 5.14.0-500.450.el9iv.x86_64
package manager: rpm-ostree
selinux: yes
is superuser: yes
summary: 1 guest provisioned
prepare
workdir: /var/tmp/tmt/run-001/plans/e2e/ffi/prepare
queued push task #1: push to default-0
push task #1: push to default-0
Push workdir to guest '18.191.21.105'.
queued prepare task #1: Install podman on default-0
queued prepare task #2: requires on default-0
prepare task #1: Install podman on default-0
how: install
name: Install podman
order: 20
Execute command 'export CONTROL_CONTAINER_NAME=host; export TMT_PLAN_DATA=/var/tmp/tmt/run-001/plans/e2e/ffi/data; export TMT_PLAN_ENVIRONMENT_FILE=/var/tmp/tmt/run-001/plans/e2e/ffi/data/variables.env; export TMT_TREE=/var/tmp/tmt/run-001/plans/e2e/ffi/tree; export TMT_VERSION=1.35.0; rpm -q --whatprovides podman' on guest '18.191.21.105'.
cmd: rpm -q --whatprovides podman
out: no package provides podman
package: 1 package requested
podman
Execute command 'export CONTROL_CONTAINER_NAME=host; export TMT_PLAN_DATA=/var/tmp/tmt/run-001/plans/e2e/ffi/data; export TMT_PLAN_ENVIRONMENT_FILE=/var/tmp/tmt/run-001/plans/e2e/ffi/data/variables.env; export TMT_TREE=/var/tmp/tmt/run-001/plans/e2e/ffi/tree; export TMT_VERSION=1.35.0; rpm -q --whatprovides podman || rpm-ostree install --apply-live --idempotent --allow-inactive podman' on guest '18.191.21.105'.
cmd: rpm -q --whatprovides podman || rpm-ostree install --apply-live --idempotent --allow-inactive podman
out: no package provides podman
err: notice: auto-inferring -y/--assumeyes when not run interactively; this will change in the future
out: Checking out tree 218334c...done
out: Enabled rpm-md repositories: baseos appstream autosd extras-common
out: Updating metadata for 'baseos'...done
out: Updating metadata for 'appstream'...done
out: Updating metadata for 'autosd'...done
out: Updating metadata for 'extras-common'...done
out: Importing rpm-md...done
out: rpm-md repo 'baseos'; generated: 2024-09-02T14:56:42Z solvables: 4455
out: rpm-md repo 'appstream'; generated: 2024-09-02T14:59:05Z solvables: 16992
out: rpm-md repo 'autosd'; generated: 2024-09-03T02:37:15Z solvables: 6788
out: rpm-md repo 'extras-common'; generated: 2024-08-06T11:03:43Z solvables: 93
out: Resolving dependencies...done
out: Will download: 20 packages (24.3?MB)
out: Downloading from 'autosd'...done
out: Importing packages...done
out: Checking out packages...done
out: Running pre scripts...done
out: Running post scripts...done
out: Running posttrans scripts...done
out: Writing rpmdb...done
out: Writing OSTree commit...done
out: Staging deployment...done
out: Computing /etc diff to preserve...done
out: Updating /usr...done
err: error: Changed directories are not supported yet
fail: Command 'rpm -q --whatprovides podman || rpm-ostree install --apply-live --idempotent --allow-inactive podman' returned 1.
finish
workdir: /var/tmp/tmt/run-001/plans/e2e/ffi/finish
Doing nothing to remove guest '18.191.21.105'.
Prune '/plans/e2e/ffi' plan workdir '/var/tmp/tmt/run-001/plans/e2e/ffi'.
Workdir '/var/tmp/tmt/run-001/plans/e2e/ffi/provision/default-0' already exists.
Workdir '/var/tmp/tmt/run-001/plans/e2e/ffi/prepare/Install-podman' created.
Workdir '/var/tmp/tmt/run-001/plans/e2e/ffi/prepare/requires' created.
Workdir '/var/tmp/tmt/run-001/plans/e2e/ffi/execute/default-0' created.
Workdir '/var/tmp/tmt/run-001/plans/e2e/ffi/report/default-0' created.
summary: 0 tasks completed
plan failed
I clearly saw that one of the messages was:
cmd: rpm -q --whatprovides podman
out: no package provides podman
package: 1 package requested
podman
So QM=podman and if no podman then no QM too.
In the end it failed.
On DUT I see that package failed to get installed:
[root@localhost ~]# rpm -q qm
package qm is not installed
[root@localhost ~]# rpm -q podman
package podman is not installed
[root@localhost ~]#
I assume that this is caused by the image auto-osbuild-qemu-autosd9-minimal-ostree-x86_64-1437090712.02176fac being an OStree.
I'm not sure that this will happen or regular image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plan failed
The exception was caused by 1 earlier exceptions
Cause number 1:
prepare step failed
The exception was caused by 1 earlier exceptions
Cause number 1:
Command 'rpm -q --whatprovides podman || rpm-ostree install --apply-live --idempotent --allow-inactive podman' returned 1.
stdout (25 lines)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no package provides podman
Checking out tree 218334c...done
Enabled rpm-md repositories: baseos appstream autosd extras-common
Updating metadata for 'baseos'...done
Updating metadata for 'appstream'...done
Updating metadata for 'autosd'...done
Updating metadata for 'extras-common'...done
Importing rpm-md...done
rpm-md repo 'baseos'; generated: 2024-09-02T14:56:42Z solvables: 4455
rpm-md repo 'appstream'; generated: 2024-09-02T14:59:05Z solvables: 16992
rpm-md repo 'autosd'; generated: 2024-09-03T02:37:15Z solvables: 6788
rpm-md repo 'extras-common'; generated: 2024-08-06T11:03:43Z solvables: 93
Resolving dependencies...done
Will download: 20 packages (24.3?MB)
Downloading from 'autosd'...done
Importing packages...done
Checking out packages...done
Running pre scripts...done
Running post scripts...done
Running posttrans scripts...done
Writing rpmdb...done
Writing OSTree commit...done
Staging deployment...done
Computing /etc diff to preserve...done
Updating /usr...done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stderr (2 lines)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
notice: auto-inferring -y/--assumeyes when not run interactively; this will change in the future
error: Changed directories are not supported yet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: nsednev <[email protected]>
Signed-off-by: nsednev <[email protected]>
Just for the notice, I still see the original issue on TC if tested against an OStree image, after running one of my tests, using modified set-ffi-env-e2e:
---^---^---^---^---^--- testing-farm:centos-stream-9-x86_64:e2e-ffi still shows: WARN[0010] StopSignal SIGTERM failed to stop container ffi-qm in 10 seconds, resorting to SIGKILL |
Can you close this one and open again in a fresh rebase? You will have a clean and green CI/CD. |
Rebased to #537 |
This is a patch for set-ffi-env-e2e forth to #521 .
It checks if the QM rpm package was installed on host.