Skip to content

Commit

Permalink
tools: add ci scripts
Browse files Browse the repository at this point in the history
We want to make sure that we do not break the default launch procedure
of KTF. Hence, add it to CI.

Signed-off-by: Norbert Manthey <[email protected]>
  • Loading branch information
nmanthey authored and wipawel committed Nov 25, 2020
1 parent f237641 commit a7028eb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/ci/build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This script builds the project's boot.iso file in the docker environment
set -e

# Execute relative to this script
SCRIPTDIR="$( cd "$(dirname "$0")" ; pwd -P )"
declare -r SCRIPTDIR

# Go to root directory of repository
cd "$SCRIPTDIR"/../..

# Build project in docker
make clean V=1
make docker:boot.iso V=1
36 changes: 36 additions & 0 deletions tools/ci/launch-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This script builds the project's boot.iso file in the docker environment and
# next launches a test and checks for a successful timeout.
set -e

# Execute relative to this script
SCRIPTDIR="$( cd "$(dirname "$0")" ; pwd -P )"
declare -r SCRIPTDIR

# Go to root directory of repository
cd "$SCRIPTDIR"/../..

# Build project in docker
echo "Building project from scratch"
make clean V=1
make docker:boot.iso V=1

# Use QEMU to launch the guest
echo "Launching KTF"
declare -i STATUS=0
timeout 10 make boot V=1 || STATUS=$?

# Check if the expected exit code happened (124 for timeout)
if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 124 ]
then
echo "error: received unexpected exit code $STATUS"
exit $STATUS
elif [ "$STATUS" -eq 124 ]
then
echo "info: terminated with expected timeout signal"
fi

exit 0

0 comments on commit a7028eb

Please sign in to comment.