Skip to content

Commit

Permalink
Add a fix in setup
Browse files Browse the repository at this point in the history
Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Dec 20, 2023
1 parent 3201261 commit 8a86628
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
5 changes: 4 additions & 1 deletion plans/e2e/ffi.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ provision:
how: local

adjust:
- when: run == manual
environment+:
USE_QM_COPR: yes
- when: scenario == ffi and distro == centos-stream-9, fedora
prepare+:
- name: Install rpms
how: install
Expand All @@ -23,7 +27,6 @@ adjust:
script: |
cd tests/e2e
./set-ffi-env-e2e --set-qm-disk-part=yes
when: scenario == ffi and distro == centos-stream-9, fedora

execute:
how: tmt
Expand Down
8 changes: 5 additions & 3 deletions plans/e2e/tier-0.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ provision:
how: local

adjust:
- when: scenario == manual
- when: run == manual
environment+:
USE_QM_COPR: yes
prepare+:
- name: Prepare Repos
- name: Prepare QM Repos
how: shell
order: 10
script: |
Expand All @@ -33,7 +35,7 @@ adjust:
how: shell
script: |
cd tests/e2e
./run-test-e2e --skip-tests=yes
./run-test-e2e --use-qm-repo --skip-tests=yes

execute:
how: tmt
Expand Down
32 changes: 27 additions & 5 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ INSTALLDIR="/usr/share/qm"
ROOTFS="/usr/lib/qm/rootfs"
RWETCFS="/etc/qm"
RWVARFS="/var/qm"
TMP_QM_IMG_DIR="tmp-img-dir"
TMP_QM_IMG_DIR="tmp.images"
AGENT_HOSTNAME="$(hostname)"
AGENTCONF="/etc/bluechi/agent.conf.d/agent.conf"
QM_CONTAINER_IDS=1000000000:1500000000
Expand Down Expand Up @@ -98,12 +98,34 @@ storage() {
touch "${ROOTFS}/var/lib/shared/overlay-images/images.lock" \
"${ROOTFS}/var/lib/shared/overlay-layers/layers.lock"

sed -e '/additionalimage.*/a "/var/lib/shared",' \
-e 's|^#.*transient_store.*|transient_store=true|g' \
"${ROOTFS}/usr/share/containers/storage.conf" \
> "${ROOTFS}/etc/containers/storage.conf"
sed -e '/additionalimage.*/a "/var/lib/shared",' \
-e 's|^#.*transient_store.*|transient_store=true|g' \
"${ROOTFS}/usr/share/containers/storage.conf" \
> "${ROOTFS}/etc/containers/storage.conf"
sed -i "s|^#env = \[\]|env = \[\"TMPDIR=/var/${TMP_QM_IMG_DIR}\"\]|" \
"${ROOTFS}/usr/share/containers/containers.conf"


sed -e '/^\s*#/d' -e '/^$/d' \
"${ROOTFS}/usr/share/containers/storage.conf" \
> "${ROOTFS}/etc/containers/storage.conf"
if ! grep -q "additionalimagestores" "${ROOTFS}/etc/containers/storage.conf"; then
cat >> "${ROOTFS}/etc/containers/storage.conf" << EOF
additionalimagestores = [
/var/lib/shared,
]
EOF
else
sed -i '/additionalimage.*/a "/var/lib/shared",'
"${ROOTFS}/etc/containers/storage.conf"
fi
if ! grep -q "transient_store" "${ROOTFS}/etc/containers/storage.conf"; then
echo transient_store=true >> "${ROOTFS}/etc/containers/storage.conf"
fi
if ! grep -q "env" "${ROOTFS}/etc/containers/containers.conf"; then
echo "env = \[\"TMPDIR=/var/${TMP_QM_IMG_DIR}\"\]" \
>> "${ROOTFS}/etc/containers/containers.conf"
fi
fi
}

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/lib/container
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ setup_node() {
# copy control as template to node${number}
cp ./lib/ContainerFile.template ContainerFile.node"${nodeID}"
if_error_exit "failed to copy ContainerFile control template to node!"
if [ -n ${use_qm-copr} ]; then
if [ -n ${use_qm_copr} ]; then
sed -e 's/crb/&\nRUN dnf -y copr enable rhcontainerbot\/qm centos-stream-9/' -i ContainerFile.node"${nodeID}"
if_error_exit "failed to sed ContainerFile node template!"
fi
Expand Down

0 comments on commit 8a86628

Please sign in to comment.