From: Michal Sojka Date: Wed, 5 Feb 2014 11:46:08 +0000 (+0100) Subject: Add first automated test and supporting infrastructure X-Git-Tag: fix-allnoconfig~48 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/e39c603ba366d806d6cf25dbaa5f78e54ea1e949 Add first automated test and supporting infrastructure --- diff --git a/continuous/gw-setup/.gitignore b/continuous/gw-setup/.gitignore new file mode 100644 index 0000000..d480cda --- /dev/null +++ b/continuous/gw-setup/.gitignore @@ -0,0 +1 @@ +initramfs/etc/init.d/S99benchmark diff --git a/continuous/gw-setup/.novaboot b/continuous/gw-setup/.novaboot new file mode 100644 index 0000000..0cd421a --- /dev/null +++ b/continuous/gw-setup/.novaboot @@ -0,0 +1 @@ +$default_target = 'ryuglab'; diff --git a/continuous/gw-setup/boot b/continuous/gw-setup/boot new file mode 100755 index 0000000..9720a55 --- /dev/null +++ b/continuous/gw-setup/boot @@ -0,0 +1,5 @@ +#!/usr/bin/env novaboot +# -*-sh-*- +load uImage console=ttyPSC0,115200 quiet +load shark-ryu.dtb +load rootfs2.uImage < gen_cpio --mkimage="-T ramdisk -A powerpc -O linux" buildroot/images/rootfs.cpio initramfs diff --git a/continuous/gw-setup/initramfs/bin/ugw b/continuous/gw-setup/initramfs/bin/ugw new file mode 120000 index 0000000..d404615 --- /dev/null +++ b/continuous/gw-setup/initramfs/bin/ugw @@ -0,0 +1 @@ +../../../../ugw/ppc/ugw \ No newline at end of file diff --git a/continuous/gw-setup/initramfs/etc/dropbear/dropbear_dss_host_key b/continuous/gw-setup/initramfs/etc/dropbear/dropbear_dss_host_key new file mode 100644 index 0000000..657c2ae Binary files /dev/null and b/continuous/gw-setup/initramfs/etc/dropbear/dropbear_dss_host_key differ diff --git a/continuous/gw-setup/initramfs/etc/dropbear/dropbear_rsa_host_key b/continuous/gw-setup/initramfs/etc/dropbear/dropbear_rsa_host_key new file mode 100644 index 0000000..6ff0f2c Binary files /dev/null and b/continuous/gw-setup/initramfs/etc/dropbear/dropbear_rsa_host_key differ diff --git a/continuous/gw-setup/initramfs/etc/init.d/S50can b/continuous/gw-setup/initramfs/etc/init.d/S50can new file mode 100755 index 0000000..d519685 --- /dev/null +++ b/continuous/gw-setup/initramfs/etc/init.d/S50can @@ -0,0 +1,7 @@ +echo Setting up CAN interfaces + +ip link set can0 type can bitrate 1000000 +ip link set up dev can0 +ip link set can1 type can bitrate 1000000 +ip link set up dev can1 +ifconfig can1 txqueuelen 100 diff --git a/continuous/gw-setup/initramfs/etc/init.d/S50dropbear b/continuous/gw-setup/initramfs/etc/init.d/S50dropbear new file mode 100755 index 0000000..7f5173e --- /dev/null +++ b/continuous/gw-setup/initramfs/etc/init.d/S50dropbear @@ -0,0 +1 @@ +echo Not starting dropbear diff --git a/continuous/gw-setup/run.pl b/continuous/gw-setup/run.pl new file mode 100755 index 0000000..d026b12 --- /dev/null +++ b/continuous/gw-setup/run.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl -w + +use FindBin; + +my $S99 = "$FindBin::Bin/initramfs/etc/init.d/S99benchmark"; +system("rm -f $S99"); +system("cat > $S99; chmod +x $S99") unless -t STDIN; + +my $boot; +my $pid = &run_boot; +$|=1; + +my $ready; +while (<$boot>){ + last if ($ready = /Welcome to Buildroot/ || /UGW started/); +} +die "Boot failed" unless $ready; + +my $latester=<<'EOF'; +rm -f tmp-stat.txt +echo "Starting latester" +sudo ip l set eth0 down +sudo ~/bin/latester -d can0 -d can1 -d can2 -c 3200 -q --oneattime -n tmp +r=$? +sudo ip l set eth0 up +set -e +source tmp-stat.txt +for i in sent lost enobufs $(seq -f percentile%g 0 10 100); do keyval="$keyval $i=$((i))"; done +echo "! PERF: gw_latency $avg µs $keyval ok" +exit $r +EOF + +my $status = system((qw(ssh -T glab), $latester)); +kill('TERM', -$pid); +exit($status >> 8); + + +sub run_boot() +{ + # die("No boot command") if ($#ARGV eq -1); + # my $bootcmd = "'".join("' '", @ARGV)."'"; + + my $bootcmd = "$FindBin::Bin/boot"; + + pipe($boot, $wh) || die("pipe: $!"); + my $pid = fork() // die("fork: $!"); + if ($pid == 0) { + setpgrp(); # Start new process group so that we can kill all + # background processes at once + close($boot); + open(STDERR, ">&", $wh) || die "Can't dup STDERR: $!"; + my $cmd = "$bootcmd | tee /dev/stderr"; + exec($cmd) || die "Can't exec $cmd: $!"; + } + close($wh); + return $pid; +} + +END { kill('TERM', -$pid) if defined $pid; } diff --git a/continuous/gw-setup/shark-ryu.dtb b/continuous/gw-setup/shark-ryu.dtb new file mode 120000 index 0000000..df8743b --- /dev/null +++ b/continuous/gw-setup/shark-ryu.dtb @@ -0,0 +1 @@ +../../kernel/build/shark/3.12/arch/powerpc/boot/shark-ryu.dtb \ No newline at end of file diff --git a/continuous/gw-setup/uImage b/continuous/gw-setup/uImage new file mode 120000 index 0000000..adfe471 --- /dev/null +++ b/continuous/gw-setup/uImage @@ -0,0 +1 @@ +../../kernel/build/shark/3.12/arch/powerpc/boot/uImage \ No newline at end of file diff --git a/continuous/tests/kernelgw b/continuous/tests/kernelgw new file mode 100755 index 0000000..2bd5594 --- /dev/null +++ b/continuous/tests/kernelgw @@ -0,0 +1,6 @@ +#!/bin/sh + +../gw-setup/run.pl <