mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
ci: Test resulting test ISO (#26)
This commit is contained in:
parent
ef90875a1c
commit
8d9ceeb579
5 changed files with 148 additions and 2 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
|
||||
31
tests/iso/os-release.sh
Normal file
31
tests/iso/os-release.sh
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
iso=$1
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y squashfs-tools
|
||||
|
||||
sudo mkdir /mnt/{iso,install}
|
||||
|
||||
# Mount ISO
|
||||
sudo mount -o loop $iso /mnt/iso
|
||||
|
||||
# Mount squashfs
|
||||
sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
||||
|
||||
FOUND_VERSION=$(cat /mnt/install/etc/os-release | grep VERSION_ID | cut -d= -f2)
|
||||
|
||||
# Cleanup
|
||||
sudo umount /mnt/install
|
||||
sudo 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue