Compare commits

..

1 commit

Author SHA1 Message Date
Brian C. Lane
4ccc7f2183 - tests: Change glusterfs to v7.* (bcl@redhat.com)
- Revert "tests: Update gpg key to fedora 32" (bcl@redhat.com)
- Dockerfile.test: Use fedora:31 for tests (bcl@redhat.com)
- test: Disable pylint subprocess check check (bcl@redhat.com)
- composer-cli: Bump the default API version to 1 (bcl@redhat.com)
- New lorax documentation - 31.10 (bcl@redhat.com)
2020-05-20 10:28:44 -07:00
7 changed files with 872 additions and 944 deletions

View file

@ -1 +0,0 @@
1

103
.gitignore vendored
View file

@ -166,105 +166,4 @@
/lorax-31.7.tar.gz
/lorax-31.8.tar.gz
/lorax-31.9.tar.gz
/lorax-31.10.tar.gz
/lorax-32.0.tar.gz
/lorax-32.1.tar.gz
/lorax-32.2.tar.gz
/lorax-32.3.tar.gz
/lorax-32.4.tar.gz
/lorax-32.5.tar.gz
/lorax-32.6.tar.gz
/lorax-32.7.tar.gz
/lorax-33.0.tar.gz
/lorax-33.1.tar.gz
/lorax-33.2.tar.gz
/lorax-33.3.tar.gz
/lorax-33.4.tar.gz
/lorax-33.5.tar.gz
/lorax-33.6.tar.gz
/lorax-33.7.tar.gz
/lorax-33.8.tar.gz
/lorax-33.9.tar.gz
/lorax-34.0.tar.gz
/lorax-34.1.tar.gz
/lorax-34.2.tar.gz
/lorax-34.3.tar.gz
/lorax-34.4.tar.gz
/lorax-34.5.tar.gz
/lorax-34.6.tar.gz
/lorax-34.7.tar.gz
/lorax-34.8.tar.gz
/lorax-34.9.tar.gz
/lorax-35.0.tar.gz
/lorax-35.1.tar.gz
/lorax-35.2.tar.gz
/lorax-35.3.tar.gz
/lorax-35.4.tar.gz
/lorax-35.5.tar.gz
/lorax-35.6.tar.gz
/lorax-35.7.tar.gz
/lorax-36.0.tar.gz
/lorax-36.1.tar.gz
/lorax-36.2.tar.gz
/lorax-36.3.tar.gz
/lorax-36.4.tar.gz
/lorax-36.5.tar.gz
/lorax-36.6.tar.gz
/lorax-36.7.tar.gz
/lorax-36.8.tar.gz
/lorax-36.9.tar.gz
/lorax-37.0.tar.gz
/lorax-37.1.tar.gz
/lorax-37.2.tar.gz
/lorax-37.3.tar.gz
/lorax-37.4.tar.gz
/lorax-37.5.tar.gz
/lorax-37.6.tar.gz
/lorax-37.7.tar.gz
/lorax-37.8.tar.gz
/lorax-38.0.tar.gz
/lorax-38.1.tar.gz
/lorax-38.2.tar.gz
/lorax-38.3.tar.gz
/lorax-38.4.tar.gz
/lorax-38.5.tar.gz
/lorax-38.6.tar.gz
/lorax-39.0.tar.gz
/lorax-39.1.tar.gz
/lorax-39.2.tar.gz
/lorax-39.3.tar.gz
/lorax-39.4.tar.gz
/lorax-39.5.tar.gz
/lorax-40.0.tar.gz
/lorax-40.1.tar.gz
/lorax-40.2.tar.gz
/lorax-40.3.tar.gz
/lorax-40.4.tar.gz
/lorax-40.5.tar.gz
/lorax-40.6.tar.gz
/lorax-41.0.tar.gz
/lorax-41.1.tar.gz
/lorax-41.2.tar.gz
/lorax-41.3.tar.gz
/lorax-42.0.tar.gz
/lorax-42.1.tar.gz
/lorax-42.2.tar.gz
/lorax-42.3.tar.gz
/lorax-42.4.tar.gz
/lorax-42.5.tar.gz
/lorax-43.0.tar.gz
/lorax-43.1.tar.gz
/lorax-43.2.tar.gz
/lorax-43.3.tar.gz
/lorax-43.4.tar.gz
/lorax-43.5.tar.gz
/lorax-43.6.tar.gz
/lorax-43.7.tar.gz
/lorax-43.8.tar.gz
/lorax-43.9.tar.gz
/lorax-43.10.tar.gz
/lorax-44.0.tar.gz
/lorax-44.1.tar.gz
/lorax-44.2.tar.gz
/lorax-44.3.tar.gz
/lorax-44.4.tar.gz
/lorax-31.11.tar.gz

View file

@ -1,7 +0,0 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts: [bodhi_update_push_stable]
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

1426
lorax.spec

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
summary: Run Lorax tests (build an iso, run mkksiso on it)
execute:
script: ./tests/scripts/run_tests.sh

View file

@ -1 +1 @@
SHA512 (lorax-44.4.tar.gz) = e2be9a13a0aec657bfe9a32dbd51e9024dfcb89471dbc57b8206dccdcd71cf5561fb25f97a7fdaca2b0279a2966b142ddf4e4544577ac2b47171f19648742577
SHA512 (lorax-31.11.tar.gz) = 551a4c47c6910ed7021a8563457b3ca996bc1809131b6ee42479048960698b4069b390f74f2d1f9be3c5e40ba26edd0e60527f8abc4e78267dadbcf0ab805a2f

View file

@ -1,274 +0,0 @@
#!/bin/bash
set -eux
FAILANY=0
BOOTISO=/var/tmp/lorax-fedora-iso/images/boot.iso
KSNAME=fedora-minimal.ks
KS="/usr/share/doc/lorax/$KSNAME"
OUTISO=/var/tmp/out.iso
ISODIR=/var/tmp/iso
## Functions for testing mkkiso
function fail {
echo -e "\n\n#### ERROR: $1\n"
FAIL=1
FAILANY=1
}
function status {
if [ "$FAIL" -eq 0 ]; then
echo -e "\n\n#### PASS: $1\n"
else
echo -e "\n\n#### FAIL: $1\n"
fi
}
function running {
FAIL=0
echo -e "\n\n#### RUN: $1\n"
}
# unmount the dirs lazily because sometimes some outside thing is still touching them
function umount_dirs {
umount --lazy "$ISODIR"
rm -f "$OUTISO"
}
[ -e "$ISODIR" ] || mkdir "$ISODIR"
# Only add kickstart
function ks_only {
running "Add kickstart to iso using --ks"
mkksiso --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
status "Add kickstart to iso using --ks"
umount_dirs
}
# Only add kickstart
function ks_pos_only {
running "Add kickstart to iso using positional argument"
mkksiso $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
status "Add kickstart to iso using positional argument"
umount_dirs
}
function test_ks {
## This all needs to be another function
# Is there a kickstart in / of the iso?
[ -e "$ISODIR/$KSNAME" ] || fail "Missing kickstart"
# Is the kickstart in the GRUB2 BIOS config?
grep "inst.ks=.*$KSNAME" "$ISODIR/boot/grub2/grub.cfg" || fail "Missing BIOS grub.cfg kickstart entry"
# Is the kickstart in the UEFI config?
grep "inst.ks=.*$KSNAME" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
}
# Add ks and cmdline
function ks_serial {
running "Add kickstart and serial cmdline"
mkksiso -c "console=ttyS0,115200n8" --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
test_serial
status "Add kickstart and serial cmdline"
umount_dirs
}
# Only add serial console to cmdline
function only_serial {
running "Add serial cmdline (no ks)"
mkksiso -c "console=ttyS0,115200n8" $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_serial
status "Add kickstart and serial cmdline"
umount_dirs
}
function test_serial {
# Is the serial in the BIOS config?
grep "console=ttyS0,115200n8" "$ISODIR/boot/grub2/grub.cfg" || fail "Missing BIOS grub.cfg cmdline entry"
# Is the serial in the UEFI config?
grep "console=ttyS0,115200n8" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg cmdline entry"
}
# New VOLID
function new_volid {
running "Use a new VOLID"
mkksiso -V "mkksiso-test" --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
test_volid
status "Use a new VOLID"
umount_dirs
}
function test_volid {
# Is the VOLID in the BIOS config?
grep "hd:LABEL=mkksiso-test" "$ISODIR/boot/grub2/grub.cfg" || fail "Missing BIOS grub.cfg kickstart entry"
# Is the VOLID in the UEFI config?
grep "hd:LABEL=mkksiso-test" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
}
# Add extra files
function add_files {
running "Add files"
mkksiso -a /etc/services --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
test_files
status "Add files"
umount_dirs
}
# Remove quiet from the cmdline
function remove_quiet {
running "remove quiet from cmdline (no ks)"
mkksiso --rm "quiet" $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_quiet
status "Remove quiet from cmdline"
umount_dirs
}
function test_quiet {
# Is quiet in the BIOS config?
! grep "append.*quiet" "$ISODIR/boot/grub2/grub.cfg" || fail "quiet not removed from BIOS grub.cfg cmdline entry"
# Is quiet in the UEFI config?
! grep "linux.*quiet" "$ISODIR/EFI/BOOT/grub.cfg" || fail "quiet not removed from UEFI grub.cfg cmdline entry"
}
# Test error if passing both --ks FILE and 3 arguments
function test_two_kickstarts {
running "Test two kickstart error"
mkksiso --ks $KS $KS $BOOTISO $OUTISO && fail "No error using --ks and positional argument"
status "Test two kickstart error"
}
function test_files {
[ -e "$ISODIR/services" ] || fail "Missing file from iso"
}
# Test adding an updates.img file
function add_updatesimg {
running "Add updates.img"
# nothing in the file, just test that it is there
touch /tmp/updates.img
mkksiso -u /tmp/updates.img $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_updatesimg
status "Add updates.img"
umount_dirs
}
function test_updatesimg {
[ -e "$ISODIR/updates.img" ] || fail "Missing updates.img file from iso"
grep "inst.updates=.*updates.img" "$ISODIR/boot/grub2/grub.cfg" || fail "Missing BIOS grub.cfg inst.updates entry"
grep "inst.updates=.*updates.img" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg inst.updates entry"
}
# All of the changes
function run_all {
running "Use all the options"
touch /tmp/updates.img
mkksiso -u /tmp/updates.img -a /etc/services -V "mkksiso-test" -c "console=ttyS0,115200n8" --rm "quiet" --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
test_serial
test_volid
test_files
test_updatesimg
test_quiet
status "Use all the options"
umount_dirs
}
# All of the changes as a user (lorax-ted) with --skip-mkefiboot
function run_as_user {
running "Use all the options as a user"
[ ! -e "/home/lorax-ted" ] && useradd -m lorax-ted
touch /tmp/updates.img
su - lorax-ted -c "mkksiso --skip-mkefiboot -u /tmp/updates.img -a /etc/services -V "mkksiso-test" -c "console=ttyS0,115200n8" --rm "quiet" --ks $KS $BOOTISO $OUTISO" || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
test_serial
test_volid
test_files
test_updatesimg
test_quiet
status "Use all the options as a user with --skip-mkefiboot"
umount_dirs
}
# Gather up the list of system repo files and use them for lorax
REPOS=$(for f in /etc/yum.repos.d/*repo; do echo -n "--repo $f "; done)
if [ -z "$REPOS" ]; then
echo "No system repos found"
exit 1
fi
# NOTE: We must use --nomacboot because the test system doesn't have the hfsplus fs available
# Run lorax using the host's repository configuration file
if [ ! -e "$BOOTISO" ]; then
running "Build boot.iso with lorax"
lorax --product="Fedora" --version=rawhide --release=rawhide --volid="Fedora-rawhide-test" \
$REPOS --isfinal --nomacboot /var/tmp/lorax-fedora-iso/ || exit 1
fi
# Test mkksiso on the new boot.iso
ks_only
ks_pos_only
ks_serial
only_serial
new_volid
add_files
remove_quiet
test_two_kickstarts
add_updatesimg
run_all
run_as_user
exit $FAILANY