mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
add tests
This commit is contained in:
parent
a78999eca9
commit
15b436cb1b
4 changed files with 62 additions and 17 deletions
1
tests/iso/README.md
Normal file
1
tests/iso/README.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Place scripts that will test the ISO. The ISO file will be passed as the first argument
|
||||
30
tests/iso/os-release.sh
Normal file
30
tests/iso/os-release.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
iso=$1
|
||||
|
||||
dnf install -y squashfs-tools
|
||||
|
||||
mkdir /mnt/{iso,install}
|
||||
|
||||
# Mount ISO
|
||||
mount -o loop $iso /mnt/iso
|
||||
|
||||
# Mount squashfs
|
||||
mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
||||
|
||||
FOUND_VERSION=$(cat /mnt/install/os-release | grep VERSION_ID | cut -d= -f2)
|
||||
|
||||
# Cleanup
|
||||
umount /mnt/install
|
||||
umount /mnt/iso
|
||||
|
||||
if [[ ${FOUND_VERSION} != ${VERSION} ]]
|
||||
then
|
||||
echo "Version mismatch"
|
||||
echo "Expected: ${VERSION}"
|
||||
echo "Found: ${FOUND_VERSION}"
|
||||
exit 1
|
||||
else
|
||||
echo "Correct version found"
|
||||
exit 0
|
||||
fi
|
||||
1
tests/vm/README.md
Normal file
1
tests/vm/README.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Place scripts that will test the VM. The VM will be available at ${VM_IP} using username ${VM_USER} and password ${VM_PASS}
|
||||
Loading…
Add table
Add a link
Reference in a new issue