2019-02-27 13:01:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Note: execute this file from the project root directory
|
|
|
|
|
|
|
|
#####
|
|
|
|
#
|
|
|
|
# Builds live-iso image and test it with QEMU-KVM
|
|
|
|
#
|
|
|
|
#####
|
|
|
|
|
2019-06-17 12:35:31 +00:00
|
|
|
set -e
|
|
|
|
|
2019-02-27 13:01:28 +00:00
|
|
|
. /usr/share/beakerlib/beakerlib.sh
|
2019-06-17 12:35:31 +00:00
|
|
|
. $(dirname $0)/lib/lib.sh
|
2019-02-27 13:01:28 +00:00
|
|
|
|
2019-03-08 10:29:11 +00:00
|
|
|
CLI="${CLI:-./src/bin/composer-cli}"
|
2019-02-27 13:01:28 +00:00
|
|
|
|
|
|
|
rlJournalStart
|
|
|
|
rlPhaseStartSetup
|
2019-06-17 12:35:31 +00:00
|
|
|
rlAssertExists $QEMU_BIN
|
2019-08-02 12:01:30 +00:00
|
|
|
|
|
|
|
OPTIONAL_REPO="/etc/yum.repos.d/rhel7-rel-eng-optional.repo"
|
|
|
|
|
|
|
|
if [ ! -f "$OPTIONAL_REPO" ]; then
|
|
|
|
cat > $OPTIONAL_REPO << __EOF__
|
|
|
|
[rhel7-rel-eng-optional]
|
|
|
|
gpgcheck=0
|
|
|
|
enabled=1
|
|
|
|
skip_if_unavailable=0
|
|
|
|
name=rhel7-rel-eng-optional
|
|
|
|
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-7/rel-eng/latest-RHEL-7/compose/Server-optional/\$basearch/os/
|
|
|
|
__EOF__
|
|
|
|
fi
|
|
|
|
|
2019-02-27 13:01:28 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartTest "compose start"
|
|
|
|
rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing"
|
|
|
|
|
|
|
|
# NOTE: live-iso.ks explicitly disables sshd but test_cli.sh enables it
|
|
|
|
UUID=`$CLI compose start example-http-server live-iso`
|
|
|
|
rlAssertEquals "exit code should be zero" $? 0
|
|
|
|
|
|
|
|
UUID=`echo $UUID | cut -f 2 -d' '`
|
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartTest "compose finished"
|
2019-09-06 16:56:19 +00:00
|
|
|
wait_for_compose $UUID
|
2019-02-27 13:01:28 +00:00
|
|
|
|
|
|
|
rlRun -t -c "$CLI compose image $UUID"
|
|
|
|
IMAGE="$UUID-live.iso"
|
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartTest "Start VM instance"
|
2019-07-23 16:42:41 +00:00
|
|
|
boot_image "-boot d -cdrom $IMAGE" 120
|
2019-02-27 13:01:28 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartTest "Verify VM instance"
|
2019-04-17 14:12:12 +00:00
|
|
|
# run generic tests to verify the instance
|
2019-07-23 16:42:41 +00:00
|
|
|
ROOT_ACCOUNT_LOCKED=0 verify_image liveuser localhost "-p $SSH_PORT"
|
2019-02-27 13:01:28 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartCleanup
|
2019-06-17 12:35:31 +00:00
|
|
|
rlRun -t -c "killall -9 $(basename $QEMU_BIN)"
|
2019-02-27 13:01:28 +00:00
|
|
|
rlRun -t -c "$CLI compose delete $UUID"
|
2019-08-02 12:01:30 +00:00
|
|
|
rlRun -t -c "rm -rf $IMAGE $OPTIONAL_REPO"
|
2019-02-27 13:01:28 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlJournalEnd
|
|
|
|
rlJournalPrintText
|