From da06f9d73fbbe2c8f925286fb5c6936ea7466b0c Mon Sep 17 00:00:00 2001 From: John Davidson Date: Sat, 29 Dec 2018 20:53:01 +0200 Subject: [PATCH] Travis CI - full automation --- .travis.yml | 7 ++----- travis/99_autoshutdown.sh | 6 +++--- travis/build_mll.sh | 2 +- travis/test_docker.sh | 8 -------- travis/test_qemu.sh | 13 ++++++------- travis/travis-ci.sh | 15 +++++++-------- 6 files changed, 19 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 959037349..baa33dce0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,5 @@ services: - docker script: -#- sudo apt-get update -- docker run --privileged -v $PWD:/minimal -it ubuntu:18.04 /bin/bash -c 'cd /minimal/travis && ./travis-ci.sh' -#- sudo chown -R $USER:$USER * -#- cd travis && ./test_qemu.sh - +- sudo apt-get -qq -y update +- cd travis && ./travis-ci.sh diff --git a/travis/99_autoshutdown.sh b/travis/99_autoshutdown.sh index 22912992a..8574622d4 100755 --- a/travis/99_autoshutdown.sh +++ b/travis/99_autoshutdown.sh @@ -1,8 +1,8 @@ -#!/bin sh +#!/bin/sh # This script shuts down the OS after one minute. -sleep 60 && poweroff & +sleep 30 && poweroff & cat << CEOF - Minimal Linux Live will shut down in 60 seconds. + Minimal Linux Live will shut down in 30 seconds. CEOF diff --git a/travis/build_mll.sh b/travis/build_mll.sh index f81a69674..59f0a93c2 100755 --- a/travis/build_mll.sh +++ b/travis/build_mll.sh @@ -6,7 +6,7 @@ set -e cd ../src -apt-get -qq -y install wget make gawk gcc bc xz-utils bison flex xorriso libelf-dev libssl-dev +sudo 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" diff --git a/travis/test_docker.sh b/travis/test_docker.sh index 46487206b..9f753ffb7 100755 --- a/travis/test_docker.sh +++ b/travis/test_docker.sh @@ -6,14 +6,6 @@ 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 diff --git a/travis/test_qemu.sh b/travis/test_qemu.sh index ff9a2b9df..a2ef0bf14 100755 --- a/travis/test_qemu.sh +++ b/travis/test_qemu.sh @@ -6,17 +6,16 @@ set -e cd ../src -apt-get -qq -y install qemu +sudo apt-get -qq -y install qemu echo "`date` | *** MLL QEMU test - BEGIN ***" -#qemu-system-x86_64 -m 256M -cdrom minimal_linux_live.iso -boot d -localtime -nographic & -qemu-system-x86_64 -m 256M -kernel work/kernel/kernel_installed/kernel -initrd work/rootfs.cpio.xz -append "console=ttyS0 console=tty0" -localtime -console +qemu-system-x86_64 -m 256M -cdrom minimal_linux_live.iso -boot d -localtime -nographic & +#qemu-system-x86_64 -m 256M -kernel work/kernel/kernel_installed/kernel -initrd work/rootfs.cpio.xz -append "console=ttyS0 console=tty0" -localtime -nographic & sleep 5 -MLL=`ps -ef | grep -i [q]emu` -if [ "$MLL" = "" ] ; then +if [ "`ps -ef | grep -i [q]emu-system-x86_64`" = "" ] ; then echo "`date` | !!! FAILURE !!! Minimal Linux Live is not running in QEMU." exit 1 else @@ -25,11 +24,11 @@ fi sleep 120 -MLL=`ps -ef | grep -i [q]emu` -if [ "$MLL" = "" ] ; then +if [ "`ps -ef | grep -i [q]emu-system-x86_64`" = "" ] ; then echo "`date` | Minimal Linux Live is not running in QEMU." else echo "`date` | !!! FAILURE !!! Minimal Linux Live is still running in QEMU." + ps -ef | grep -i [q]emu-system-x86_64 exit 1 fi diff --git a/travis/travis-ci.sh b/travis/travis-ci.sh index b1bb5df0f..465afde49 100755 --- a/travis/travis-ci.sh +++ b/travis/travis-ci.sh @@ -5,18 +5,17 @@ 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 -#sed -i "s|OVERLAY_LOCATION.*|OVERLAY_LOCATION=rootfs|" ../src/.config +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 +sed -i "s|OVERLAY_LOCATION.*|OVERLAY_LOCATION=rootfs|" ../src/.config while true; do sleep 300; echo "`date` | >>> Heartbeat <<<"; done & -apt-get -qq update +sudo apt-get -qq update ./build_mll.sh -#./test_qemu.sh -#./test_docker.sh +./test_docker.sh +./test_qemu.sh set +e -