diff --git a/Osstest.pm b/Osstest.pm index 9ba2882..a86e1b3 100644 --- a/Osstest.pm +++ b/Osstest.pm @@ -179,6 +179,8 @@ sub readglobalconfig () { $c{OverlayLocal} ||= "overlay-local"; $c{GuestDebianSuite} ||= $c{DebianSuite}; + $c{DebianArches} ||= 'i386 amd64 armhf'; + $c{DefaultBranch} ||= 'xen-unstable'; } diff --git a/standalone-reset b/standalone-reset index 621de59..7f46e29 100755 --- a/standalone-reset +++ b/standalone-reset @@ -40,7 +40,7 @@ fi ensure_dir () { if test -d "$1"; then return; fi - mkdir "$1" + mkdir -p "$1" } ensure_key () { @@ -91,9 +91,10 @@ else diver=`getconfig TftpDiVersion` suite=`getconfig DebianSuite` firmware=`getconfig DebianNonfreeFirmware` + arches=`getconfig DebianArches` if [ "x$diver" = xcurrent ]; then - for arch in i386 amd64 armhf; do + for arch in $arches; do if test -d "$tftp/$dibase/$arch/$diver" then continue; fi mkdir -p "$tftp/$dibase/$arch" diff --git a/ts-host-install b/ts-host-install index 5c0018e..dfbc950 100755 --- a/ts-host-install +++ b/ts-host-install @@ -122,7 +122,7 @@ END sub setup_pxeboot_firstboot($) { my ($ps_url) = @_; - my $d_i= $c{TftpDiBase}.'/'.$r{arch}.'/'.$c{TftpDiVersion}.'-'.$ho->{Suite}; + my $d_i= $c{TftpDiBase}.'/'.$r{arch}.'/'.$c{TftpDiVersion}; my @installcmdline= qw(vga=normal); push @installcmdline, di_installcmdline_core($ho, $ps_url, %xopts); diff --git a/ts-host-suspend b/ts-host-suspend new file mode 100755 index 0000000..4fc9b5b --- /dev/null +++ b/ts-host-suspend @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w +use DBI; +use POSIX; + +use strict qw(vars); +use Osstest; +use Osstest::Debian; +use Osstest::TestSupport; + +tsreadconfig(); + +our ($whhost) = @ARGV; +$whhost ||= 'host'; +our $ho= selecthost($whhost); + +# totally arbitrary value to sleep +my $time_to_suspend = 30; + +my $RTC = "/sys/class/rtc/rtc0"; +my $epoch = target_cmd_output_root($ho, "cat " . $RTC . "/since_epoch"); + +# Clear the wake alarm +target_cmd_root($ho, "echo 0 > " . $RTC . "/wakealarm"); +# Set the wake alarm to NOW + time +target_cmd_root($ho, "echo " . ($epoch + $time_to_suspend) . " > " . $RTC . "/wakealarm"); + +# Put the machine to sleep +target_cmd_root($ho, "pm-suspend"); + +# TODO: - Wait until system goes into S3 +# - Determine some way to tell if it failed to go into S3 diff --git a/ts-xen-install b/ts-xen-install index ae1e0f8..61ebb65 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -49,7 +49,7 @@ my %distpath; sub packages () { target_install_packages($ho, qw(bridge-utils vncsnapshot libaio1 libpixman-1-0 - libsdl1.2debian libglib2.0-0)); + libsdl1.2debian libglib2.0-0 pm-utils)); target_install_packages($ho, $ho->{Suite} =~ /squeeze/ ? "libyajl1" : "libyajl2"); if ($r{arch} eq 'i386') {