Skip to content

Commit

Permalink
Adding tmt tier-0 test
Browse files Browse the repository at this point in the history
Tests are run by packit through tmt in testsing-farm
Adding integration plan and tier-0 test verifying
initoverlayfs setup

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Nov 30, 2023
1 parent 64f4410 commit b0cdec5
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
20 changes: 20 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: rpm/initoverlayfs.spec
upstream_tag_template: v{version}

srpm_build_deps:
- make

jobs:
- job: tests
trigger: pull_request
identifier: integration-tiers
tmt_plan: /integration/plans/tier-0
skip_build: true
targets:
targets:
- centos-stream-9-x86_64
- fedora-39-x86_64
38 changes: 38 additions & 0 deletions integration/plans/tier-0.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
summary: Tier 0 - initoverlayfs

discover:
how: fmf
filter: tier:0

provision:
how: local

adjust:
prepare+:
- name: Prepare c9s Repo
how: shell
order: 10
script: |
dnf install -y epel-release
when: distro == centos-stream-9

prepare:
- name: Prepare Repos
how: shell
script: |
dnf copr enable -y @centos-automotive-sig/next
- name: Install rpms
how: install
package: initoverlayfs

- name: Verify rpm
how: shell
script: |
echo $(rpm -qa | grep -i initoverlayfs)

execute:
how: tmt

report:
how: junit

5 changes: 5 additions & 0 deletions integration/tests/boot-validation/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
summary: test verify install is working
test: ./test.sh
tier: 0
framework: shell

36 changes: 36 additions & 0 deletions integration/tests/boot-validation/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

if [ "${TMT_REBOOT_COUNT}" == "1" ];then
echo -n "machine is up"
exit 0
#echo -n "Verifying initoverlayfs in /boot"
fi

RPM_EXIST=$(rpm -qa | grep -i initoverlayfs)

if [ -z "${RPM_EXIST}" ]; then
echo -n "initoverlayfs rpm is missing"
exit 127
fi

echo -n "Install initoverlayfs"
/usr/bin/initoverlayfs-install

exit_code="$?"

if [ "$exit_code" != "0" ]; then
echo -n "initoverlayfs-install completeted with $exit_code"
exit "$exit_code"
fi

echo -n "Verifying initoverlayfs in /boot"
du -sh /boot/init* | grep initoverlayfs

exit_code="$?"
if [ "$exit_code" != "0" ]; then
echo -n "initoverlayfs not found under /boot please check runnin machine"
exit "$exit_code"
fi

/usr/local/bin/tmt-reboot

0 comments on commit b0cdec5

Please sign in to comment.