Travis CI updates.

Travis CI configuration improvements.

Added separate test script for Travis CI.

Travis CI updates.

Travis CI updates.

Travis CI related fixes.

Travis CI will use Docker for the tests.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Travis CI updates.

Temporarily enabled debug logging. This has to be reverted later.

Travis CI updates.

Travis CI updates.

Travis CI updates. Docker in privileged mode.

Travis CI updates.

Travis CI updates.

Travis CI updates. MLL Docker test should run fine now.

Added QEMU related tests for Travis CI.

Last minute fix.

Major reorganization. Docker test fails for some reason.

Last minute fix.

Last minute fix.

Removed the 'sudo' hack.

This should fix the Docker test.

Enabled all tests.

Docker fix.

Experimenting...

Experimenting...

Experimenting...

Experiments...

I give up. Way too many hacks. Travis CI may be good for other projects but it doesn't bring much value for MLL.
This commit is contained in:
Ivan Davidov 2018-06-21 19:05:25 +03:00 committed by Ivan Davidov
parent 0fc72f3501
commit c8e0ac2a21
8 changed files with 160 additions and 5 deletions

View File

@ -8,7 +8,4 @@ services:
- docker
script:
- sudo apt-get install wget make gawk gcc bc bison flex xorriso libelf-dev libssl-dev
- cd src
- ./build_minimal_linux_live.sh
- ./test_docker_image.sh
- docker run --privileged -v $PWD:/minimal -it ubuntu:18.04 /bin/bash -c 'cd /minimal/travis && ./travis-ci.sh'

View File

@ -2,7 +2,7 @@
set -e
SRC_DIR=`realpath --no-symlinks $PWD`
SRC_DIR=$PWD
CONFIG=$SRC_DIR/.config
SOURCE_DIR=$SRC_DIR/source
WORK_DIR=$SRC_DIR/work

8
travis/99_autoshutdown.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin sh
# This script shuts down the OS after one minute.
sleep 60 && poweroff &
cat << CEOF
 Minimal Linux Live will shut down in 60 seconds.
CEOF

43
travis/build_mll.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
# This script is supposed to be executed by Travis CI.
set -e
cd ../src
apt-get -qq -y install wget make gawk gcc bc xz-utils bison flex xorriso libelf-dev libssl-dev
PREFIXES="00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16"
for PREFIX in ${PREFIXES}
do
SCRIPTS=`ls ${PREFIX}_*.sh`
for SCRIPT in ${SCRIPTS}
do
echo "`date` | Running script '${SCRIPT}'."
set +e
./${SCRIPT} > /tmp/mll.log 2>&1
set -e
if [ "$?" = "0" ] ; then
echo "`date` | Success."
else
echo "`date` | !!! FAILURE !!!"
tail -n 1000 /tmp/mll.log
exit 1
fi
done
done
cat << CEOF
######################
# #
# MLL build is OK. #
# #
######################
CEOF
set +e

6
travis/syslinux.cfg Normal file
View File

@ -0,0 +1,6 @@
SERIAL 0
DEFAULT operatingsystem
LABEL operatingsystem
LINUX /boot/kernel.xz
APPEND console=tty0 console=ttyS0
INITRD /boot/rootfs.xz

34
travis/test_docker.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# This script is supposed to be executed by Travis CI.
set -e
cd ../src
apt-get -qq -y install docker.io
#service docker start
dockerd &
sleep 30
docker run hello-world
echo "`date` | *** MLL Docker test - BEGIN ***"
docker import mll_image.tgz minimal-linux-live:latest
docker run minimal-linux-live /bin/cat /etc/motd
echo "`date` | *** MLL Docker test - END ***"
cat << CEOF
#########################
# #
# Docker test passed. #
# #
#########################
CEOF
set +e

47
travis/test_qemu.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/sh
# This script is supposed to be executed by Travis CI.
set -e
cd ../src
apt-get -qq -y install qemu
echo "`date` | *** MLL QEMU test - BEGIN ***"
qemu-system-x86_64 -m 1024M -cdrom minimal_linux_live.iso -boot d -localtime -nographic &
sleep 5
MLL=`ps -ef | grep -i [q]emu`
if [ "$MLL" = "" ] ; then
echo "`date` | !!! FAILURE !!! Minimal Linux Live is not running in QEMU."
exit 1
else
echo "`date` | Minimal Linux Live is running in QEMU. Waiting 120 seconds for automatic shutdown."
fi
sleep 120
MLL=`ps -ef | grep -i [q]emu`
if [ "$MLL" = "" ] ; then
echo "`date` | Minimal Linux Live is not running in QEMU."
else
echo "`date` | !!! FAILURE !!! Minimal Linux Live is still running in QEMU."
exit 1
fi
echo "`date` | *** MLL QEMU test - END ***"
cat << CEOF
#######################
# #
# QEMU test passed. #
# #
#######################
CEOF
set +e

20
travis/travis-ci.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# This script is supposed to be executed by Travis CI.
set -e
# Apply Travis specific patches
mkdir -p ../src/minimal_overlay/rootfs/etc/autorun
cp 99_autoshutdown.sh ../src/minimal_overlay/rootfs/etc/autorun
cp -f syslinux.cfg ../src/minimal_boot/bios/boot/syslinux/syslinux.cfg
while true; do sleep 300; echo "`date` | >>> Heartbeat <<<"; done &
apt-get -qq update
./build_mll.sh
#./test_qemu.sh
#./test_docker.sh
set +e