Skip to content
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

Rebase for Check if QM is installed #537

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

nsednev
Copy link
Collaborator

@nsednev nsednev commented Sep 5, 2024

Fix #521

This is a REBASE for patch for set-ffi-env-e2e forth to #521 .
It checks if the QM rpm package was installed on host.

@nsednev nsednev mentioned this pull request Sep 5, 2024
@nsednev
Copy link
Collaborator Author

nsednev commented Sep 5, 2024

@dougsland @pengshanyu @Yarboa
I tested the code against local VM running with:
CentOS Stream release 9
Linux ibm-p8-kvm-03-guest-02.virt.pnr.lab.eng.rdu2.redhat.com 5.14.0-503.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 22 17:03:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
I took it from CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2.

I checked that on the VM there was no podman installed before testing it, then I ran the tmt like so:
tmt -c distro=centos-stream-9 run -a provision --how connect -u root -p ${PASSWORD} -P ${PORT} -g localhost plans -n /plans/e2e/tier-0

The result was:
stdout (8/8 lines)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ INFO ] Starting setup
[ INFO ] ==============================

    [ INFO  ] Check if qm requires additional partition
    [ INFO  ] ==============================

    [ INFO  ] Checking if QM already installed
    [ INFO  ] ==============================
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    stderr (100/103 lines)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ++ cd -- .
    ++ pwd
    + SCRIPT_DIR=/var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e
    + source /var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e/lib/utils
    + source /var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e/lib/container
    + source /var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e/lib/systemd
    + source /var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e/lib/tests
    ++ NODES_FOR_TESTING_ARR='control qm-node1'
    ++ readarray -d ' ' -t NODES_FOR_TESTING
    ++ CONTROL_CONTAINER_NAME=control
    ++ WAIT_BLUECHI_AGENT_CONNECT=5
    + source /var/tmp/tmt/run-001/plans/e2e/tier-0/tree/tests/e2e/lib/diskutils
    + export CONFIG_NODE_AGENT_PATH=/etc/bluechi/agent.conf.d/agent.conf
    + CONFIG_NODE_AGENT_PATH=/etc/bluechi/agent.conf.d/agent.conf
    + export REGISTRY_UBI8_MINIMAL=registry.access.redhat.com/ubi8/ubi-minimal
    + REGISTRY_UBI8_MINIMAL=registry.access.redhat.com/ubi8/ubi-minimal
    + export WAIT_BLUECHI_SERVER_BE_READY_IN_SEC=5
    + WAIT_BLUECHI_SERVER_BE_READY_IN_SEC=5
    + export CONTROL_CONTAINER_NAME=control
    + CONTROL_CONTAINER_NAME=control
    + NODES_FOR_TESTING=('control' 'node1')
    + export NODES_FOR_TESTING
    + export IP_CONTROL_MACHINE=
    + IP_CONTROL_MACHINE=
    + export CONTAINER_CAP_ADD=
    + CONTAINER_CAP_ADD=
    + export ARCH=
    + ARCH=
    + export DISK=
    + DISK=
    + export PART_ID=
    + PART_ID=
    + export QC_SOC=SA8775P
    + QC_SOC=SA8775P
    + export SOC_DISTRO_FILE=/sys/devices/soc0/machine
    + SOC_DISTRO_FILE=/sys/devices/soc0/machine
    + export QC_SOC_DISK=sde
    + QC_SOC_DISK=sde
    + export BUILD_BLUECHI_FROM_GH_URL=
    + BUILD_BLUECHI_FROM_GH_URL=
    + export QM_GH_URL=
    + QM_GH_URL=
    + export BRANCH_QM=
    + BRANCH_QM=
    + export SET_QM_PART=
    + SET_QM_PART=
    + export USE_QM_COPR=rhcontainerbot/qm
    + USE_QM_COPR=rhcontainerbot/qm
    + RED='\033[91m'
    + GRN='\033[92m'
    + CLR='\033[0m'
    + ARGUMENT_LIST=("qm-setup-from-gh-url" "branch-qm" "set-qm-disk-part" "use-qm-copr")
    +++ printf help,%s:, qm-setup-from-gh-url branch-qm set-qm-disk-part use-qm-copr
    +++ basename ./set-ffi-env-e2e
    ++ getopt --longoptions help,qm-setup-from-gh-url:,help,branch-qm:,help,set-qm-disk-part:,help,use-qm-copr:, --name set-ffi-env-e2e --options '' -- none
    + opts=' -- '\''none'\'''
    + eval set '-- -- '\''none'\'''
    ++ set -- -- none
    + '[' 2 -gt 0 ']'
    + case "$1" in
    + break
    + info_message 'Starting setup'
    + '[' -z 'Starting setup' ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] Starting setup'
    + info_message ==============================
    + '[' -z ============================== ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] =============================='
    + '[' 0 -ne 0 ']'
    + stat /run/ostree-booted
    + echo
    + info_message 'Check if qm requires additional partition'
    + '[' -z 'Check if qm requires additional partition' ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] Check if qm requires additional partition'
    + info_message ==============================
    + '[' -z ============================== ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] =============================='
    + '[' -n '' ']'
    + echo
    + info_message 'Checking if QM already installed'
    + '[' -z 'Checking if QM already installed' ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] Checking if QM already installed'
    + info_message ==============================
    + '[' -z ============================== ']'
    + BLUE='\033[94m'
    + ENDCOLOR='\033[0m'
    + echo -e '[ \033[94mINFO\033[0m  ] =============================='
    ++ rpm -qa qm
    + QM_INST=
    ++ systemctl is-enabled qm
    + QM_STATUS='Failed to get unit file state for qm.service: No such file or directory'
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On VM I checked that it installed podman-5.2.2-1.el9.x86_64 and had not ran the QM at all:
[root@ibm-p8-kvm-03-guest-02 ~]# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@ibm-p8-kvm-03-guest-02 ~]#

@Yarboa
Copy link
Collaborator

Yarboa commented Sep 5, 2024

@nsednev
Can you please describe shortly, what is the problem exactly, with the change?

@dougsland
Copy link
Collaborator

@nsednev from the output I see your are kindly not using the right patch maybe?

    ++ rpm -qa qm
    + QM_INST=
    ++ systemctl is-enabled qm
    + QM_STATUS='Failed to get unit file state for qm.service: No such file or directory'

This part of code is weird to my eyes, could you please share the code? First, should be rpm -q qm, not rpm -qa qm. This is not good for such operation, as will list all packages to query only qm (not really required) and in case of error will output a message.

@nsednev nsednev force-pushed the VROOM-22506 branch 3 times, most recently from 7981661 to 46f0b06 Compare September 5, 2024 15:22
@nsednev
Copy link
Collaborator Author

nsednev commented Sep 5, 2024

Tested on distro: CentOS Stream 9:
Linux ibm-p8-kvm-03-guest-02.virt.pnr.lab.eng.rdu2.redhat.com 5.14.0-503.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 22 17:03:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2

No podman and qm installed on clean and fresh OS:
[root@ibm-p8-kvm-03-guest-02 ~]# rpm -qa podman
[root@ibm-p8-kvm-03-guest-02 ~]# rpm -qa qm
[root@ibm-p8-kvm-03-guest-02 ~]#

Running tmt tier-0 against VM:

    multihost name: default-0
    arch: x86_64
    distro: CentOS Stream 9

    summary: 1 guest provisioned
prepare
    queued push task #1: push to default-0
    
    push task #1: push to default-0

    queued prepare task #1: Install podman on default-0
    queued prepare task #2: Set QM environment on default-0
    queued prepare task #3: requires on default-0
    
    prepare task #1: Install podman on default-0
    how: install
    name: Install podman
    package: podman
    
    prepare task #2: Set QM environment on default-0
    how: shell
    name: Set QM environment
    overview: 1 script found
    
    prepare task #3: requires on default-0
    how: install
    summary: Install required packages
    name: requires
    where: default-0
    package: /usr/bin/flock

    queued pull task #1: pull from default-0
    
    pull task #1: pull from default-0

    summary: 3 preparations applied
execute
    queued execute task #1: default-0 on default-0
    
    execute task #1: default-0 on default-0
    how: tmt
    progress:                                                           

    summary: 6 tests executed
report
    how: junit
    output: /var/tmp/tmt/run-010/plans/e2e/tier-0/report/default-0/junit.xml
    summary: 6 tests passed
finish

    summary: 0 tasks completed

total: 6 tests passed

On VM I see:
[root@ibm-p8-kvm-03-guest-02 ~]# rpm -qa podman
podman-5.2.2-1.el9.x86_64
[root@ibm-p8-kvm-03-guest-02 ~]# rpm -qa qm
qm-0.6.5-1.20240903182315916484.main.77.g64fc09a.el9.noarch

[root@ibm-p8-kvm-03-guest-02 ~]# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
717d6c2cfa7c /sbin/init 6 minutes ago Up 6 minutes qm

tests/e2e/set-ffi-env-e2e Outdated Show resolved Hide resolved
tests/e2e/set-ffi-env-e2e Outdated Show resolved Hide resolved
Copy link
Collaborator

@dougsland dougsland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, needs just small changes.

@dougsland
Copy link
Collaborator

and of course, pass in ci/cd

Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dougsland
This scenario is tested manually, in ci/cd there is already qm installed
either on osbuild regular image or the gate, since new rpm created in pipeline and installed before tests begin

this sufficient i assume
#537
#521 (comment)

@dougsland dougsland merged commit 515a26e into containers:main Sep 6, 2024
9 of 10 checks passed
@nsednev nsednev deleted the VROOM-22506 branch September 8, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set-ffi-env-e2e aborts when executing tests manually with tmt
3 participants