]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: add check that iscsi daemon /etc/hosts matches host /etc/hosts 49824/head
authorAdam King <adking@redhat.com>
Mon, 30 Jan 2023 16:27:09 +0000 (11:27 -0500)
committerAdam King <adking@redhat.com>
Mon, 27 Mar 2023 18:01:30 +0000 (14:01 -0400)
To make sure we aren't being affected by any podman introduced
changes to the /etc/hosts file and test that we're properly
mounting /etc/hosts in our daemon containers

Signed-off-by: Adam King <adking@redhat.com>
qa/suites/orch/cephadm/workunits/task/test_iscsi_container/+ [new file with mode: 0644]
qa/suites/orch/cephadm/workunits/task/test_iscsi_container/.qa [new symlink]
qa/suites/orch/cephadm/workunits/task/test_iscsi_container/centos_8.stream_container_tools.yaml [new symlink]
qa/suites/orch/cephadm/workunits/task/test_iscsi_container/test_iscsi_container.yaml [new file with mode: 0644]
qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/+ [deleted file]
qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/.qa [deleted symlink]
qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/centos_8.stream_container_tools.yaml [deleted symlink]
qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/test_iscsi_pids_limit.yaml [deleted file]
qa/workunits/cephadm/test_iscsi_etc_hosts.sh [new file with mode: 0755]

diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/+ b/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/.qa b/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/centos_8.stream_container_tools.yaml b/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/centos_8.stream_container_tools.yaml
new file mode 120000 (symlink)
index 0000000..7a86f96
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/test_iscsi_container.yaml b/qa/suites/orch/cephadm/workunits/task/test_iscsi_container/test_iscsi_container.yaml
new file mode 100644 (file)
index 0000000..19d302c
--- /dev/null
@@ -0,0 +1,21 @@
+roles:
+- - host.a
+  - osd.0
+  - osd.1
+  - osd.2
+  - mon.a
+  - mgr.a
+  - client.0
+tasks:
+- install:
+- cephadm:
+- cephadm.shell:
+    host.a:
+      - ceph osd pool create foo
+      - rbd pool init foo
+      - ceph orch apply iscsi foo u p
+- workunit:
+    clients:
+      client.0:
+        - cephadm/test_iscsi_pids_limit.sh
+        - cephadm/test_iscsi_etc_hosts.sh
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/+ b/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/+
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/.qa b/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/.qa
deleted file mode 120000 (symlink)
index a602a03..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../.qa/
\ No newline at end of file
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/centos_8.stream_container_tools.yaml b/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/centos_8.stream_container_tools.yaml
deleted file mode 120000 (symlink)
index 7a86f96..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/test_iscsi_pids_limit.yaml b/qa/suites/orch/cephadm/workunits/task/test_iscsi_pids_limit/test_iscsi_pids_limit.yaml
deleted file mode 100644 (file)
index b271777..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-roles:
-- - host.a
-  - osd.0
-  - osd.1
-  - osd.2
-  - mon.a
-  - mgr.a
-  - client.0
-tasks:
-- install:
-- cephadm:
-- cephadm.shell:
-    host.a:
-      - ceph osd pool create foo
-      - rbd pool init foo
-      - ceph orch apply iscsi foo u p
-- workunit:
-    clients:
-      client.0:
-        - cephadm/test_iscsi_pids_limit.sh
diff --git a/qa/workunits/cephadm/test_iscsi_etc_hosts.sh b/qa/workunits/cephadm/test_iscsi_etc_hosts.sh
new file mode 100755 (executable)
index 0000000..adbc34a
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# checks if the container and host's /etc/hosts files match
+# Necessary to avoid potential bugs caused by podman making
+# edits to /etc/hosts file in the container
+# exits with code 1 if host and iscsi container /etc/hosts do no match
+
+set -ex
+
+ISCSI_DAEMON=$(sudo /home/ubuntu/cephtest/cephadm ls | jq -r '.[] | select(.service_name == "iscsi.foo") | .name')
+sudo /home/ubuntu/cephtest/cephadm enter --name $ISCSI_DAEMON -- cat /etc/hosts > iscsi_daemon_etc_hosts.txt
+if cmp --silent /etc/hosts iscsi_daemon_etc_hosts.txt; then
+  echo "Daemon and host /etc/hosts files successfully matched"
+else
+  echo "ERROR: /etc/hosts on host did not match /etc/hosts in the iscsi container!"
+  echo "Host /etc/hosts:"
+  cat /etc/hosts
+  echo "Iscsi container /etc/hosts:"
+  cat iscsi_daemon_etc_hosts.txt
+  exit 1
+fi