File tree Expand file tree Collapse file tree 9 files changed +128
-1
lines changed Expand file tree Collapse file tree 9 files changed +128
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ summary: Kvm Tier 0 - QM sanity test
2
2
3
3
discover:
4
4
how: fmf
5
- filter: 'tier:0&tag:kvm'
5
+ filter: 'tier:0&tag:kvm|tier:0&tag:qmctl-test '
6
6
7
7
prepare+:
8
8
- name: Enable copr and install rpms
Original file line number Diff line number Diff line change
1
+ output: This is the file to copy
Original file line number Diff line number Diff line change
1
+ This is the file to copy
Original file line number Diff line number Diff line change
1
+ summary: Test plan for QMCTL using TMT
2
+ test: ./test_qmctl.sh
3
+ duration: 10m
4
+ tag: qmctl-test
5
+ tier: 0
6
+ framework: shell
7
+ id: 9b3f962e-758a-473b-b8ea-540a177b9134
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # shellcheck disable=SC1091
4
+ . ../e2e/lib/utils
5
+
6
+ QMCTL_SCRIPT=" ../../tools/qmctl/qmctl"
7
+
8
+ python3 $QMCTL_SCRIPT cp ./files/file-to-copy.txt qm:/tmp
9
+
10
+ expected_output_file=" ./files/file-to-check-cp.txt"
11
+ actual_output_temp_file=$( mktemp)
12
+
13
+ python3 $QMCTL_SCRIPT exec cat /tmp/file-to-copy.txt > " $actual_output_temp_file "
14
+
15
+ if diff " $actual_output_temp_file " " $expected_output_file " > /dev/null; then
16
+ info_message " The output matches the content of '$expected_output_file '."
17
+ info_message " PASS: qmctl cp command executed successfully"
18
+ exit 0
19
+ else
20
+ echo " FAIL: The output does NOT match the content of '$expected_output_file '."
21
+ exit 1
22
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # shellcheck disable=SC1091
4
+ . ../e2e/lib/utils
5
+
6
+ QMCTL_SCRIPT=" ../../tools/qmctl/qmctl"
7
+
8
+ if python3 $QMCTL_SCRIPT exec podman ps -a | grep -q " alpine-podman" ; then
9
+ echo " FAIL: podman named alpine-container already exists"
10
+ exit 1
11
+ fi
12
+
13
+ python3 $QMCTL_SCRIPT exec podman run -d --name alpine-podman alpine tail -f /dev/null
14
+
15
+ if ! python3 $QMCTL_SCRIPT exec podman ps -a | grep -q " alpine-podman" ; then
16
+ echo " FAIL: podman container was not created"
17
+ exit 1
18
+ fi
19
+
20
+ info_message " PASS: qmctl exec command executed successfully"
21
+ exit 0
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # shellcheck disable=SC1091
4
+ . ../e2e/lib/utils
5
+
6
+ QMCTL_SCRIPT=" ../../tools/qmctl/qmctl"
7
+
8
+ tmp_file=" /tmp/file-execin.txt"
9
+ if python3 $QMCTL_SCRIPT execin alpine-podman ls -la /tmp/ | grep -q $tmp_file ; then
10
+ echo " FAIL: The file /tmp/file-execin.txt already exists"
11
+ exit 1
12
+ fi
13
+
14
+ python3 $QMCTL_SCRIPT execin alpine-podman touch /tmp/file-execin.txt
15
+
16
+ if ! python3 $QMCTL_SCRIPT execin alpine-podman cat /tmp/file-execin.txt; then
17
+ echo " FAIL: The file /tmp/file-execin.txt was not created"
18
+ exit 1
19
+ fi
20
+
21
+ info_message " PASS: qmctl execin command executed successfully"
22
+ exit 0
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # shellcheck disable=SC1091
4
+ . ../e2e/lib/utils
5
+
6
+ QMCTL_SCRIPT=" ../../tools/qmctl/qmctl"
7
+
8
+ expected_output_file=" /usr/share/containers/systemd/qm.container"
9
+ actual_output_temp_file=$( mktemp)
10
+
11
+ python3 $QMCTL_SCRIPT show > " $actual_output_temp_file "
12
+
13
+ if diff " $actual_output_temp_file " " $expected_output_file " > /dev/null; then
14
+ info_message " The output matches the content of '$expected_output_file '."
15
+ info_message " PASS: qmctl show command executed successfully"
16
+ exit 0
17
+ else
18
+ echo " FAIL: The output does NOT match the content of '$expected_output_file '."
19
+ exit 1
20
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # shellcheck disable=SC1091
4
+ . ../e2e/lib/utils
5
+
6
+ info_message " Running qmctl command..."
7
+
8
+ QMCTL_SCRIPT=" ../../tools/qmctl/qmctl"
9
+
10
+ if [ ! -f " $QMCTL_SCRIPT " ]; then
11
+ echo " FAIL: qmctl script not found at $QMCTL_SCRIPT "
12
+ exit 1
13
+ fi
14
+
15
+ if ! ./scripts/qmctl_show.sh ; then
16
+ echo " FAIL: qmctl show failed."
17
+ exit 1
18
+ fi
19
+
20
+ if ! ./scripts/qmctl_exec.sh; then
21
+ echo " FAIL: qmctl exec failed."
22
+ exit 1
23
+ fi
24
+
25
+ if ! ./scripts/qmctl_execin.sh; then
26
+ echo " FAIL: qmctl execin failed."
27
+ exit 1
28
+ fi
29
+
30
+ if ! ./scripts/qmctl_cp.sh; then
31
+ echo " FAIL: qmctl cp failed."
32
+ exit 1
33
+ fi
You can’t perform that action at this time.
0 commit comments