Skip to content

Commit d9b629b

Browse files
author
Jon Ludlam
committed
Add kronos-test directory
Signed-off-by: Jon Ludlam <[email protected]>
1 parent 333b1de commit d9b629b

13 files changed

+393
-14
lines changed

kronos-test/install.sh

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -e
5+
export PATH=$PATH:/usr/groups/xencore/systems/bin
6+
PWD=`pwd`
7+
8+
HOST=st01
9+
10+
ln -sf kronos-ubuntu-staging-as /usr/groups/netboot/jludlam/$HOST
11+
echo "Rebooting host"
12+
13+
xenuse --reboot -f $HOST
14+
xenuse --reboot -f $HOST
15+
16+
sleep 300
17+
18+
ln -sf default /usr/groups/netboot/jludlam/$HOST
19+
20+
echo "Now waiting for SSH to be up"
21+
22+
ssh_timeout="1200"
23+
ssh_interval="10"
24+
ssh_time=0;
25+
26+
while ! echo | nc $HOST 22 && [[ $ssh_time -lt $ssh_timeout ]] ; do
27+
ssh_time=$(($ssh_time+$ssh_interval))
28+
sleep $ssh_interval
29+
done
30+
31+
if [ $ssh_time -ge $ssh_timeout ]; then
32+
echo "Timed out waiting for SSH to start"
33+
exit 1
34+
fi
35+
36+
echo "SSH is up"
37+
38+
./known_hosts_fix.sh $HOST
39+
sshpass -p xenroot ssh root@$HOST -o StrictHostKeyChecking=no echo
40+
sshpass -p xenroot ssh-copy-id root@$HOST -o StrictHostKeyChecking=no
41+
42+
scp ./run_test_suite.sh $HOST:
43+
ssh $HOST bash ./run_test_suite.sh &> test.log
44+
45+

kronos-test/known_hosts_fix.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# A simple shell script to clean (delete) ~/.known_hosts file hostname entry.
3+
# This is useful when remote server reinstalled or ssh keys are changed!
4+
# -------------------------------------------------------------------------
5+
# Copyright (c) 2007 nixCraft project <http://cyberciti.biz/fb/>
6+
# This script is licensed under GNU GPL version 2.0 or above
7+
# -------------------------------------------------------------------------
8+
# This script is part of nixCraft shell script collection (NSSC)
9+
# Visit http://bash.cyberciti.biz/ for more information.
10+
# -------------------------------------------------------------------------
11+
12+
host="$1"
13+
14+
[[ $# -eq 0 ]] && { echo "Usage: $0 host.name.com"; exit 1;}
15+
16+
ips=$(host "$host" | awk -F'address' '{ print $2}' | sed -e 's/^ //g')
17+
ssh-keygen -R "$host"
18+
for i in $ips
19+
do
20+
ssh-keygen -R "$i"
21+
done

kronos-test/run_test_suite.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
4+
# Set up NFS SR
5+
6+
SR=`xe sr-create type=nfs device-config:server=lork.uk.xensource.com device-config:serverpath=/mnt/vol0/nfs1/scratch1/kronos-test name-label=nfs`
7+
POOL=`xe pool-list --minimal`
8+
xe pool-param-set uuid=$POOL default-SR=$SR
9+
HOST=`xe pool-param-get uuid=$POOL param-name=master`
10+
xe pif-scan host-uuid=$HOST
11+
12+
template=`xe template-list name-label="Debian Squeeze 6.0 (32-bit)" --minimal`
13+
vm=`xe vm-install template=$template new-name-label=debian`
14+
network=`xe network-list bridge=xenbr0 --minimal`
15+
vif=`xe vif-create vm-uuid=$vm network-uuid=$network device=0`
16+
xe vm-param-set uuid=$vm other-config:install-repository=http://ftp.uk.debian.org/debian
17+
xe vm-param-set uuid=$vm PV-args="auto-install/enable=true url=http://www.uk.xensource.com/kronos/squeeze_preseed.cfg interface=auto netcfg/dhcp_timeout=600 hostname=myvm domain=uk.xensource.com"
18+
xe vm-start uuid=$vm
19+
20+
21+
ip_timeout="1800"
22+
ip_interval="10"
23+
ip_time=0;
24+
25+
IP=`xe vm-param-get uuid=$vm param-name=networks param-key=0/ip`
26+
27+
while [ $? -eq 1 ] && [[ $ip_time -lt $ip_timeout ]] ; do
28+
ip_time=$(($ip_time+$ip_interval))
29+
sleep $ip_interval
30+
IP="`xe vm-param-get uuid=$vm param-name=networks param-key=0/ip`"
31+
done
32+
33+
IP="`xe vm-param-get uuid=$vm param-name=networks param-key=0/ip`"
34+
35+
if [ $? -eq 1 ]; then
36+
echo "Debian guest failed to get IP"
37+
exit 1
38+
fi
39+

kronos-tools/kronos_preseed.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ d-i apt-setup/local0/repository string \
4242
http://downloads.xen.org/XCP/debian/repo/debian unstable main
4343
d-i apt-setup/local0/source boolean true
4444
d-i apt-setup/local0/key string http://downloads.xen.org/XCP/debian/xcp.gpg.key
45-
d-i pkgsel/include string xapi
45+
d-i pkgsel/include string xcp-xapi
4646

4747
# Dash must die!
4848
dash dash/sh boolean false
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Locale setup. Should this default to en_US instead?
2+
d-i debian-installer/locale string en_GB
3+
d-i keyboard-configuration/layoutcode string en_GB
4+
d-i keyboard-configuration/xkb-keymap string en_GB
5+
d-i time/zone string string Europe/London
6+
7+
# Mirror setup
8+
d-i mirror/country string manual
9+
d-i mirror/http/hostname string ftp.uk.debian.org
10+
d-i mirror/http/directory string /debian/
11+
d-i mirror/http/proxy string
12+
d-i mirror/udeb/suite string squeeze
13+
d-i mirror/suite string squeeze
14+
#d-i mirror/udeb/suite string sid
15+
#d-i mirror/suite string sid
16+
#d-i debian-installer/allow_unauthenticated string true
17+
#d-i anna/no_kernel_modules boolean true
18+
19+
# Partitioning -- do we want to do anything special for this part? Perhaps
20+
# install LVM, or leave a physical partition open for local storage?
21+
d-i partman-auto/method string regular
22+
d-i partman-auto/choose_recipe \
23+
select All files in one partition (recommended for new users)
24+
d-i partman/confirm_write_new_label boolean true
25+
d-i partman/choose_partition \
26+
select Finish partitioning and write changes to disk
27+
d-i partman/confirm boolean true
28+
29+
# Root user setup
30+
d-i passwd/make-user boolean false
31+
d-i passwd/root-password password xenroot
32+
d-i passwd/root-password-again password xenroot
33+
popularity-contest popularity-contest/participate boolean false
34+
35+
# Packages to install. We should install Kronos packages here.
36+
tasksel tasksel/first multiselect standard
37+
d-i pkgsel/include string \
38+
openssh-server vim ntp ethtool tpcdump bridge-util \
39+
rsync ssmtp strace gdb build-essential
40+
d-i base-installer/kernel/image string linux-image-686-pae
41+
d-i apt-setup/local0/repository string \
42+
http://10.80.238.190/kronos/latest/sid/apt/debian/ unstable main
43+
d-i apt-setup/local0/source boolean true
44+
d-i apt-setup/local0/key string http://downloads.xen.org/XCP/debian/xcp.gpg.key
45+
d-i pkgsel/include string xcp-xapi
46+
47+
# Dash must die!
48+
dash dash/sh boolean false
49+
50+
# Grub setup
51+
d-i grub-installer/only_debian boolean true
52+
d-i grub-installer/with_other_os boolean true
53+
54+
# We can do post-install scripts!!!
55+
#d-i preseed/late_command string \
56+
#cd /target; \
57+
#wget ftp://ftp.deathcat.dci/pub/ubuntu/scripts/post-install; \
58+
#chmod +x ./post-install; \
59+
#chroot ./ ./post-install; \
60+
#rm -f ./post-install
61+
62+
# And we're done.
63+
d-i finish-install/reboot_in_progress note
64+
#d-i debian-installer/exit/poweroff boolean true
65+
#d-i debian-installer/exit/always_halt boolean true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#######################################################################
2+
#
3+
# Ubuntu Kronos unattended install preseed file
4+
#
5+
#######################################################################
6+
7+
# Include kronos defaults (change this to a sensible location)
8+
d-i preseed/include string \
9+
kronos_staging_ubuntu_preseed.cfg
10+
11+
# Locale setup. Should this default to en_US instead?
12+
d-i debian-installer/locale string en_GB
13+
d-i keyboard-configuration/layoutcode string en_GB
14+
d-i keyboard-configuration/xkb-keymap string en_GB
15+
d-i time/zone string string Europe/London
16+
d-i clock-setup/utc boolean true
17+
18+
# Partitioning done in main preseed file. Here we just ignore confirmation.
19+
d-i partman/default_filesystem string ext4
20+
d-i partman-partitioning/confirm_write_new_label boolean true
21+
d-i partman/choose_partition select finish
22+
d-i partman/confirm boolean true
23+
d-i partman/confirm_nooverwrite boolean true
24+
25+
# Root user setup
26+
d-i passwd/root-login boolean true
27+
d-i passwd/make-user boolean false
28+
d-i passwd/root-password password xenroot
29+
d-i passwd/root-password-again password xenroot
30+
d-i user-setup/allow-password-weak boolean true
31+
d-i user-setup/encrypt-home boolean false
32+
33+
# Packages installed in main preseed file
34+
popularity-contest popularity-contest/participate boolean false
35+
d-i pkgsel/update-policy select none
36+
37+
d-i preseed/late_command string \
38+
wget http://www.uk.xensource.com/kronos/post_install.sh && chmod +x ./post_install.sh && ./post_install.sh
39+
40+
# And we're done.
41+
d-i finish-install/reboot_in_progress note
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#######################################################################
2+
#
3+
# Ubuntu Kronos install preseed file
4+
#
5+
#######################################################################
6+
7+
# Mirror setup
8+
d-i mirror/country string manual
9+
d-i mirror/http/hostname string archive.ubuntu.com
10+
d-i mirror/http/directory string /ubuntu
11+
d-i mirror/http/proxy string
12+
d-i mirror/udeb/suite string oneiric
13+
d-i mirror/suite string oneiric
14+
15+
# Partitioning -- do we want to do anything special for this part?
16+
# Such as leave a physical partition open for local storage?
17+
d-i partman-auto/method string regular
18+
d-i partman-auto/choose_recipe select home
19+
20+
# Packages to install. We should install Kronos packages here.
21+
tasksel tasksel/first multiselect standard
22+
d-i pkgsel/include string \
23+
openssh-server vim ntp ethtool \
24+
rsync ssmtp strace gdb build-essential xcp-xapi xcp-guest-templates blktap-dkms
25+
d-i base-installer/kernel/image string linux-server
26+
d-i apt-setup/local0/repository string \
27+
http://10.80.238.190/kronos/latest/oneiric/apt/debian/ unstable main
28+
d-i apt-setup/local0/source boolean true
29+
d-i apt-setup/local0/key string \
30+
http://downloads.xen.org/XCP/debian/xcp.gpg.key
31+
d-i pkgsel/updatedb boolean false
32+
33+
# Grub setup
34+
d-i grub-installer/only_debian boolean true
35+
36+
# We can do post-install scripts if necessary
37+
#d-i preseed/late_command string \
38+
# <commands> ; \
39+
40+
# And we're done.
41+
#d-i finish-install/reboot_in_progress note
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#######################################################################
2+
#
3+
# Ubuntu Kronos unattended install preseed file
4+
#
5+
#######################################################################
6+
7+
# Include kronos defaults (change this to a sensible location)
8+
d-i preseed/include string \
9+
kronos_staging_ubuntu_preseed.cfg
10+
11+
# Locale setup. Should this default to en_US instead?
12+
d-i debian-installer/locale string en_GB
13+
d-i keyboard-configuration/layoutcode string en_GB
14+
d-i keyboard-configuration/xkb-keymap string en_GB
15+
d-i time/zone string string Europe/London
16+
d-i clock-setup/utc boolean true
17+
18+
# Partitioning done in main preseed file. Here we just ignore confirmation.
19+
d-i partman/default_filesystem string ext4
20+
d-i partman-partitioning/confirm_write_new_label boolean true
21+
d-i partman/choose_partition select finish
22+
d-i partman/confirm boolean true
23+
d-i partman/confirm_nooverwrite boolean true
24+
25+
# Root user setup
26+
d-i passwd/root-login boolean true
27+
d-i passwd/make-user boolean false
28+
d-i passwd/root-password password xenroot
29+
d-i passwd/root-password-again password xenroot
30+
d-i user-setup/allow-password-weak boolean true
31+
d-i user-setup/encrypt-home boolean false
32+
33+
# Packages installed in main preseed file
34+
popularity-contest popularity-contest/participate boolean false
35+
d-i pkgsel/update-policy select none
36+
37+
# And we're done.
38+
d-i finish-install/reboot_in_progress note
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#######################################################################
2+
#
3+
# Ubuntu Kronos install preseed file
4+
#
5+
#######################################################################
6+
7+
# Mirror setup
8+
d-i mirror/country string manual
9+
d-i mirror/http/hostname string archive.ubuntu.com
10+
d-i mirror/http/directory string /ubuntu
11+
d-i mirror/http/proxy string
12+
d-i mirror/udeb/suite string oneiric
13+
d-i mirror/suite string oneiric
14+
15+
# Partitioning -- do we want to do anything special for this part?
16+
# Such as leave a physical partition open for local storage?
17+
d-i partman-auto/method string regular
18+
d-i partman-auto/choose_recipe select home
19+
20+
# Packages to install. We should install Kronos packages here.
21+
tasksel tasksel/first multiselect standard
22+
d-i pkgsel/include string \
23+
openssh-server vim ntp ethtool tpcdump bridge-util \
24+
rsync ssmtp strace gdb build-essential
25+
d-i base-installer/kernel/image string linux-server
26+
d-i apt-setup/local0/repository string \
27+
http://ppa.launchpad.net/ubuntu-xen-org/xcp/ubuntu oneiric main
28+
d-i apt-setup/local0/source boolean true
29+
d-i apt-setup/local0/key string \
30+
http://keyserver.ubuntu.com:11371/pks/lookup?search=0x38C2AD4AAFB82FD33CF9D16379B578FB9273A937&op=get
31+
d-i pkgsel/include string xcp-xapi
32+
d-i pkgsel/updatedb boolean false
33+
34+
# Dash must die!
35+
dash dash/sh boolean false
36+
37+
# Grub setup
38+
d-i grub-installer/only_debian boolean true
39+
40+
# We can do post-install scripts if necessary
41+
#d-i preseed/late_command string \
42+
# <commands> ; \
43+
44+
# And we're done.
45+
#d-i finish-install/reboot_in_progress note

kronos-tools/kronos_ubuntu_preseed-unattended.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ d-i partman/confirm_nooverwrite boolean true
2525
# Root user setup
2626
d-i passwd/root-login boolean true
2727
d-i passwd/make-user boolean false
28-
d-i passwd/root-password password kronos
29-
d-i passwd/root-password-again password kronos
28+
d-i passwd/root-password password xenroot
29+
d-i passwd/root-password-again password xenroot
3030
d-i user-setup/allow-password-weak boolean true
3131
d-i user-setup/encrypt-home boolean false
3232

kronos-tools/kronos_ubuntu_preseed.cfg

+12-10
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,26 @@ d-i partman-auto/method string regular
1818
d-i partman-auto/choose_recipe select home
1919

2020
# Packages to install. We should install Kronos packages here.
21-
tasksel tasksel/first multiselect \
22-
standard, server, openssh-server
21+
tasksel tasksel/first multiselect standard
2322
d-i pkgsel/include string \
24-
openssh-server vim ntp ethtool bridge-utils \
25-
rsync ssmtp strace gdb build-essential xcp-xapi
23+
openssh-server vim ntp ethtool tpcdump bridge-util \
24+
rsync ssmtp strace gdb build-essential
2625
d-i base-installer/kernel/image string linux-server
2726
d-i apt-setup/local0/repository string \
2827
http://downloads.xen.org/XCP/debian/repo/debian unstable main
2928
d-i apt-setup/local0/source boolean true
3029
d-i apt-setup/local0/key string \
3130
http://downloads.xen.org/XCP/debian/xcp.gpg.key
31+
d-i pkgsel/include string xcp-xapi
3232
d-i pkgsel/updatedb boolean false
3333

3434
# Grub setup
35-
d-i grub-installer/only_debian boolean true
35+
d-i grub-installer/only_debian boolean true
3636

37-
# Post-install script to set Xen to the default grub entry
38-
d-i preseed/late_command string \
39-
sed -i -e 's/GRUB_DEFAULT=.*$/GRUB_DEFAULT="Xen 4.1-amd64"/' \
40-
/target/etc/default/grub ; \
41-
in-target update-grub
37+
# We can do post-install scripts if necessary
38+
d-i preseed/late_command string \
39+
mv /etc/grub.d/20_linux_xen /etc/grub.d/09_linux_xen ; \
40+
update-grub
41+
42+
# And we're done.
43+
#d-i finish-install/reboot_in_progress note

0 commit comments

Comments
 (0)