Tests: global search/replace of obsolete functions
This commit is contained in:
parent
d380152f39
commit
ecd7bc9310
@ -22,34 +22,34 @@ with pkgs;
|
||||
'' startAll;
|
||||
|
||||
# mDNS.
|
||||
$one->waitForJob("network.target");
|
||||
$one->mustSucceed("avahi-resolve-host-name one.local | tee out >&2");
|
||||
$one->mustSucceed("test \"`cut -f1 < out`\" = one.local");
|
||||
$one->mustSucceed("avahi-resolve-host-name two.local | tee out >&2");
|
||||
$one->mustSucceed("test \"`cut -f1 < out`\" = two.local");
|
||||
$one->waitForUnit("network.target");
|
||||
$one->succeed("avahi-resolve-host-name one.local | tee out >&2");
|
||||
$one->succeed("test \"`cut -f1 < out`\" = one.local");
|
||||
$one->succeed("avahi-resolve-host-name two.local | tee out >&2");
|
||||
$one->succeed("test \"`cut -f1 < out`\" = two.local");
|
||||
|
||||
$two->waitForJob("network.target");
|
||||
$two->mustSucceed("avahi-resolve-host-name one.local | tee out >&2");
|
||||
$two->mustSucceed("test \"`cut -f1 < out`\" = one.local");
|
||||
$two->mustSucceed("avahi-resolve-host-name two.local | tee out >&2");
|
||||
$two->mustSucceed("test \"`cut -f1 < out`\" = two.local");
|
||||
$two->waitForUnit("network.target");
|
||||
$two->succeed("avahi-resolve-host-name one.local | tee out >&2");
|
||||
$two->succeed("test \"`cut -f1 < out`\" = one.local");
|
||||
$two->succeed("avahi-resolve-host-name two.local | tee out >&2");
|
||||
$two->succeed("test \"`cut -f1 < out`\" = two.local");
|
||||
|
||||
# Basic DNS-SD.
|
||||
$one->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out >&2");
|
||||
$one->mustSucceed("test `wc -l < out` -gt 0");
|
||||
$two->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out >&2");
|
||||
$two->mustSucceed("test `wc -l < out` -gt 0");
|
||||
$one->succeed("avahi-browse -r -t _workstation._tcp | tee out >&2");
|
||||
$one->succeed("test `wc -l < out` -gt 0");
|
||||
$two->succeed("avahi-browse -r -t _workstation._tcp | tee out >&2");
|
||||
$two->succeed("test `wc -l < out` -gt 0");
|
||||
|
||||
# More DNS-SD.
|
||||
$one->execute("avahi-publish -s \"This is a test\" _test._tcp 123 one=1 &");
|
||||
$one->sleep(5);
|
||||
$two->mustSucceed("avahi-browse -r -t _test._tcp | tee out >&2");
|
||||
$two->mustSucceed("test `wc -l < out` -gt 0");
|
||||
$two->succeed("avahi-browse -r -t _test._tcp | tee out >&2");
|
||||
$two->succeed("test `wc -l < out` -gt 0");
|
||||
|
||||
# NSS-mDNS.
|
||||
$one->mustSucceed("getent hosts one.local >&2");
|
||||
$one->mustSucceed("getent hosts two.local >&2");
|
||||
$two->mustSucceed("getent hosts one.local >&2");
|
||||
$two->mustSucceed("getent hosts two.local >&2");
|
||||
$one->succeed("getent hosts one.local >&2");
|
||||
$one->succeed("getent hosts two.local >&2");
|
||||
$two->succeed("getent hosts one.local >&2");
|
||||
$two->succeed("getent hosts two.local >&2");
|
||||
'';
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ in
|
||||
startAll;
|
||||
|
||||
# Enable NAT on the router and start miniupnpd.
|
||||
$router->waitForJob("nat");
|
||||
$router->waitForUnit("nat");
|
||||
$router->succeed(
|
||||
"iptables -t nat -N MINIUPNPD",
|
||||
"iptables -t nat -A PREROUTING -i eth1 -j MINIUPNPD",
|
||||
@ -79,7 +79,7 @@ in
|
||||
$tracker->succeed("chmod 644 /tmp/test.torrent");
|
||||
|
||||
# Start the tracker. !!! use a less crappy tracker
|
||||
$tracker->waitForJob("network.target");
|
||||
$tracker->waitForUnit("network.target");
|
||||
$tracker->succeed("bittorrent-tracker --port 6969 --dfile /tmp/dstate >&2 &");
|
||||
$tracker->waitForOpenPort(6969);
|
||||
|
||||
@ -87,8 +87,8 @@ in
|
||||
my $pid = $tracker->succeed("transmission-cli /tmp/test.torrent -M -w /tmp/data >&2 & echo \$!");
|
||||
|
||||
# Now we should be able to download from the client behind the NAT.
|
||||
$tracker->waitForJob("httpd");
|
||||
$client1->waitForJob("network.target");
|
||||
$tracker->waitForUnit("httpd");
|
||||
$client1->waitForUnit("network.target");
|
||||
$client1->succeed("transmission-cli http://tracker/test.torrent -w /tmp >&2 &");
|
||||
$client1->waitForFile("/tmp/test.tar.bz2");
|
||||
$client1->succeed("cmp /tmp/test.tar.bz2 ${file}");
|
||||
@ -98,7 +98,7 @@ in
|
||||
|
||||
# Now download from the second client. This can only succeed if
|
||||
# the first client created a NAT hole in the router.
|
||||
$client2->waitForJob("network.target");
|
||||
$client2->waitForUnit("network.target");
|
||||
$client2->succeed("transmission-cli http://tracker/test.torrent -M -w /tmp >&2 &");
|
||||
$client2->waitForFile("/tmp/test.tar.bz2");
|
||||
$client2->succeed("cmp /tmp/test.tar.bz2 ${file}");
|
||||
|
@ -59,22 +59,22 @@ rec {
|
||||
''
|
||||
startAll;
|
||||
|
||||
$share->waitForJob("checkable");
|
||||
$fsCheck->waitForJob("checkable");
|
||||
$share->waitForUnit("checkable");
|
||||
$fsCheck->waitForUnit("checkable");
|
||||
|
||||
# check repos1
|
||||
$fsCheck->mustSucceed("test -d /repos1");
|
||||
$share->mustSucceed("touch /repos1/test1");
|
||||
$fsCheck->mustSucceed("test -e /repos1/test1");
|
||||
$fsCheck->succeed("test -d /repos1");
|
||||
$share->succeed("touch /repos1/test1");
|
||||
$fsCheck->succeed("test -e /repos1/test1");
|
||||
|
||||
# check repos2 (check after remount)
|
||||
$fsCheck->mustSucceed("test -d /repos2");
|
||||
$share->mustSucceed("touch /repos2/test2");
|
||||
$fsCheck->mustSucceed("test -e /repos2/test2");
|
||||
$fsCheck->succeed("test -d /repos2");
|
||||
$share->succeed("touch /repos2/test2");
|
||||
$fsCheck->succeed("test -e /repos2/test2");
|
||||
|
||||
# check without network
|
||||
$share->block();
|
||||
$fsCheck->mustFail("test -e /repos1/test1");
|
||||
$fsCheck->mustFail("test -e /repos2/test2");
|
||||
$fsCheck->fail("test -e /repos1/test1");
|
||||
$fsCheck->fail("test -e /repos2/test2");
|
||||
'';
|
||||
}
|
||||
|
@ -25,9 +25,9 @@
|
||||
''
|
||||
startAll;
|
||||
|
||||
$walled->waitForJob("firewall");
|
||||
$walled->waitForJob("httpd");
|
||||
$attacker->waitForJob("network.target");
|
||||
$walled->waitForUnit("firewall");
|
||||
$walled->waitForUnit("httpd");
|
||||
$attacker->waitForUnit("network.target");
|
||||
|
||||
# Local connections should still work.
|
||||
$walled->succeed("curl -v http://localhost/ >&2");
|
||||
|
@ -110,24 +110,24 @@ let
|
||||
# Create a channel on the web server containing a few packages
|
||||
# to simulate the Nixpkgs channel.
|
||||
$webserver->start;
|
||||
$webserver->waitForJob("httpd");
|
||||
$webserver->mustSucceed("mkdir /tmp/channel");
|
||||
$webserver->mustSucceed(
|
||||
$webserver->waitForUnit("httpd");
|
||||
$webserver->succeed("mkdir /tmp/channel");
|
||||
$webserver->succeed(
|
||||
"nix-push file:///tmp/channel " .
|
||||
"http://nixos.org/releases/nixos/channels/nixos-unstable " .
|
||||
"file:///tmp/channel/MANIFEST ${toString channelContents} >&2");
|
||||
''}
|
||||
|
||||
# Make sure that we get a login prompt etc.
|
||||
$machine->mustSucceed("echo hello");
|
||||
$machine->waitForJob("tty1");
|
||||
$machine->waitForJob("rogue");
|
||||
$machine->waitForJob("nixos-manual");
|
||||
$machine->waitForJob("dhcpcd");
|
||||
$machine->succeed("echo hello");
|
||||
$machine->waitForUnit("tty1");
|
||||
$machine->waitForUnit("rogue");
|
||||
$machine->waitForUnit("nixos-manual");
|
||||
$machine->waitForUnit("dhcpcd");
|
||||
|
||||
${optionalString testChannel ''
|
||||
# Allow the machine to talk to the fake nixos.org.
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"rm /etc/hosts",
|
||||
"echo 192.168.1.1 nixos.org > /etc/hosts",
|
||||
"ifconfig eth1 up 192.168.1.2",
|
||||
@ -135,9 +135,9 @@ let
|
||||
);
|
||||
|
||||
# Test nix-env.
|
||||
$machine->mustFail("hello");
|
||||
$machine->mustSucceed("nix-env -i hello");
|
||||
$machine->mustSucceed("hello") =~ /Hello, world/
|
||||
$machine->fail("hello");
|
||||
$machine->succeed("nix-env -i hello");
|
||||
$machine->succeed("hello") =~ /Hello, world/
|
||||
or die "bad `hello' output";
|
||||
''}
|
||||
|
||||
@ -145,12 +145,12 @@ let
|
||||
${createPartitions}
|
||||
|
||||
# Create the NixOS configuration.
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"mkdir -p /mnt/etc/nixos",
|
||||
"nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
|
||||
);
|
||||
|
||||
my $cfg = $machine->mustSucceed("cat /mnt/etc/nixos/hardware.nix");
|
||||
my $cfg = $machine->succeed("cat /mnt/etc/nixos/hardware.nix");
|
||||
print STDERR "Result of the hardware scan:\n$cfg\n";
|
||||
|
||||
$machine->copyFileFromHost(
|
||||
@ -158,10 +158,10 @@ let
|
||||
"/mnt/etc/nixos/configuration.nix");
|
||||
|
||||
# Perform the installation.
|
||||
$machine->mustSucceed("nixos-install >&2");
|
||||
$machine->succeed("nixos-install >&2");
|
||||
|
||||
# Do it again to make sure it's idempotent.
|
||||
$machine->mustSucceed("nixos-install >&2");
|
||||
$machine->succeed("nixos-install >&2");
|
||||
|
||||
$machine->shutdown;
|
||||
|
||||
@ -176,18 +176,18 @@ let
|
||||
$machine->waitForUnit("swap.target");
|
||||
$machine->succeed("cat /proc/swaps | grep -q /dev");
|
||||
|
||||
$machine->mustSucceed("nix-env -i coreutils >&2");
|
||||
$machine->mustSucceed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/
|
||||
$machine->succeed("nix-env -i coreutils >&2");
|
||||
$machine->succeed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/
|
||||
or die "nix-env failed";
|
||||
|
||||
$machine->mustSucceed("nixos-rebuild switch >&2");
|
||||
$machine->succeed("nixos-rebuild switch >&2");
|
||||
|
||||
$machine->shutdown;
|
||||
|
||||
# And just to be sure, check that the machine still boots after
|
||||
# "nixos-rebuild switch".
|
||||
my $machine = createMachine({ hda => "harddisk", hdaInterface => "${iface}" });
|
||||
$machine->waitForJob("network.target");
|
||||
$machine->waitForUnit("network.target");
|
||||
$machine->shutdown;
|
||||
'';
|
||||
|
||||
@ -211,7 +211,7 @@ in {
|
||||
simple = makeTest
|
||||
{ createPartitions =
|
||||
''
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"parted /dev/vda mklabel msdos",
|
||||
"parted /dev/vda -- mkpart primary linux-swap 1M 1024M",
|
||||
"parted /dev/vda -- mkpart primary ext2 1024M -1s",
|
||||
@ -230,7 +230,7 @@ in {
|
||||
separateBoot = makeTest
|
||||
{ createPartitions =
|
||||
''
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"parted /dev/vda mklabel msdos",
|
||||
"parted /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
|
||||
"parted /dev/vda -- mkpart primary linux-swap 50MB 1024M",
|
||||
@ -253,7 +253,7 @@ in {
|
||||
lvm = makeTest
|
||||
{ createPartitions =
|
||||
''
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"parted /dev/vda mklabel msdos",
|
||||
"parted /dev/vda -- mkpart primary 1M 2048M", # first PV
|
||||
"parted /dev/vda -- set 1 lvm on",
|
||||
@ -276,7 +276,7 @@ in {
|
||||
swraid = makeTest
|
||||
{ createPartitions =
|
||||
''
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"parted /dev/vda --"
|
||||
. " mklabel msdos"
|
||||
. " mkpart primary ext2 1M 30MB" # /boot
|
||||
@ -310,7 +310,7 @@ in {
|
||||
grub1 = makeTest
|
||||
{ createPartitions =
|
||||
''
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"parted /dev/sda mklabel msdos",
|
||||
"parted /dev/sda -- mkpart primary linux-swap 1M 1024M",
|
||||
"parted /dev/sda -- mkpart primary ext2 1024M -1s",
|
||||
@ -337,19 +337,19 @@ in {
|
||||
$machine->start;
|
||||
|
||||
# Enable sshd service.
|
||||
$machine->mustSucceed(
|
||||
$machine->succeed(
|
||||
"sed -i 's,^}\$,jobs.sshd.startOn = pkgs.lib.mkOverride 0 \"startup\"; },' /etc/nixos/configuration.nix"
|
||||
);
|
||||
|
||||
my $cfg = $machine->mustSucceed("cat /etc/nixos/configuration.nix");
|
||||
my $cfg = $machine->succeed("cat /etc/nixos/configuration.nix");
|
||||
print STDERR "New CD config:\n$cfg\n";
|
||||
|
||||
# Apply the new CD configuration.
|
||||
$machine->mustSucceed("nixos-rebuild test");
|
||||
$machine->succeed("nixos-rebuild test");
|
||||
|
||||
# Connect to it-self.
|
||||
#$machine->waitForJob("sshd");
|
||||
#$machine->mustSucceed("ssh root@127.0.0.1 echo hello");
|
||||
#$machine->waitForUnit("sshd");
|
||||
#$machine->succeed("ssh root@127.0.0.1 echo hello");
|
||||
|
||||
$machine->shutdown;
|
||||
'';
|
||||
|
@ -31,12 +31,12 @@
|
||||
testScript =
|
||||
''
|
||||
# Start the router first so that it respond to router solicitations.
|
||||
$router->waitForJob("radvd");
|
||||
$router->waitForUnit("radvd");
|
||||
|
||||
startAll;
|
||||
|
||||
$client->waitForJob("network.target");
|
||||
$server->waitForJob("network.target");
|
||||
$client->waitForUnit("network.target");
|
||||
$server->waitForUnit("network.target");
|
||||
|
||||
# Wait until the given interface has a non-tentative address of
|
||||
# the desired scope (i.e. has completed Duplicate Address
|
||||
|
@ -31,7 +31,7 @@
|
||||
$machine->waitForWindow(qr/plasma-desktop/);
|
||||
|
||||
# Check that logging in has given the user ownership of devices.
|
||||
$machine->mustSucceed("getfacl /dev/snd/timer | grep -q alice");
|
||||
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 kwrite /var/log/messages &'");
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://localhost/ &'");
|
||||
|
@ -24,17 +24,17 @@ with pkgs;
|
||||
''
|
||||
startAll;
|
||||
|
||||
$master->mustSucceed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
|
||||
$master->mustSucceed("chmod 600 /etc/mpd.conf");
|
||||
$master->mustSucceed("mpd --daemon --ifhn=master --listenport=4444");
|
||||
$master->succeed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
|
||||
$master->succeed("chmod 600 /etc/mpd.conf");
|
||||
$master->succeed("mpd --daemon --ifhn=master --listenport=4444");
|
||||
|
||||
$slave->mustSucceed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
|
||||
$slave->mustSucceed("chmod 600 /etc/mpd.conf");
|
||||
$slave->mustSucceed("mpd --daemon --host=master --port=4444");
|
||||
$slave->succeed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
|
||||
$slave->succeed("chmod 600 /etc/mpd.conf");
|
||||
$slave->succeed("mpd --daemon --host=master --port=4444");
|
||||
|
||||
$master->mustSucceed("mpicc -o example -Wall ${./mpich-example.c}");
|
||||
$slave->mustSucceed("mpicc -o example -Wall ${./mpich-example.c}");
|
||||
$master->succeed("mpicc -o example -Wall ${./mpich-example.c}");
|
||||
$slave->succeed("mpicc -o example -Wall ${./mpich-example.c}");
|
||||
|
||||
$master->mustSucceed("mpiexec -n 2 ./example >&2");
|
||||
$master->succeed("mpiexec -n 2 ./example >&2");
|
||||
'';
|
||||
}
|
||||
|
@ -48,10 +48,10 @@ in
|
||||
testScript = ''
|
||||
startAll;
|
||||
|
||||
$master->waitForJob("mysql");
|
||||
$master->waitForJob("mysql");
|
||||
$slave2->waitForJob("mysql");
|
||||
$master->waitForUnit("mysql");
|
||||
$master->waitForUnit("mysql");
|
||||
$slave2->waitForUnit("mysql");
|
||||
$slave2->sleep(100); # Hopefully this is long enough!!
|
||||
$slave2->mustSucceed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
|
||||
$slave2->succeed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
|
||||
'';
|
||||
}
|
||||
|
@ -15,8 +15,8 @@
|
||||
testScript = ''
|
||||
startAll;
|
||||
|
||||
$master->waitForJob("mysql");
|
||||
$master->waitForUnit("mysql");
|
||||
$master->sleep(10); # Hopefully this is long enough!!
|
||||
$master->mustSucceed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
|
||||
$master->succeed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
|
||||
'';
|
||||
}
|
||||
|
@ -40,18 +40,18 @@
|
||||
startAll;
|
||||
|
||||
# The router should have access to the server.
|
||||
$server->waitForJob("httpd");
|
||||
$router->waitForJob("network.target");
|
||||
$server->waitForUnit("httpd");
|
||||
$router->waitForUnit("network.target");
|
||||
$router->succeed("curl --fail http://server/ >&2");
|
||||
|
||||
# The client should be also able to connect via the NAT router.
|
||||
$router->waitForJob("nat");
|
||||
$client->waitForJob("network.target");
|
||||
$router->waitForUnit("nat");
|
||||
$client->waitForUnit("network.target");
|
||||
$client->succeed("curl --fail http://server/ >&2");
|
||||
$client->succeed("ping -c 1 server >&2");
|
||||
|
||||
# Test whether passive FTP works.
|
||||
$server->waitForJob("vsftpd");
|
||||
$server->waitForUnit("vsftpd");
|
||||
$server->succeed("echo Hello World > /home/ftp/foo.txt");
|
||||
$client->succeed("curl -v ftp://server/foo.txt >&2");
|
||||
|
||||
|
@ -34,16 +34,16 @@ in
|
||||
|
||||
testScript =
|
||||
''
|
||||
$server->waitForJob("nfsd");
|
||||
$server->waitForJob("network.target");
|
||||
$server->waitForUnit("nfsd");
|
||||
$server->waitForUnit("network.target");
|
||||
|
||||
startAll;
|
||||
|
||||
$client1->waitForJob("data.mount");
|
||||
$client1->waitForUnit("data.mount");
|
||||
$client1->succeed("echo bla > /data/foo");
|
||||
$server->succeed("test -e /data/foo");
|
||||
|
||||
$client2->waitForJob("data.mount");
|
||||
$client2->waitForUnit("data.mount");
|
||||
$client2->succeed("echo bla > /data/bar");
|
||||
$server->succeed("test -e /data/bar");
|
||||
|
||||
@ -67,7 +67,7 @@ in
|
||||
$client2->waitForFile("locked");
|
||||
|
||||
# Test whether locks survive a reboot of the server.
|
||||
$client1->waitForJob("data.mount");
|
||||
$client1->waitForUnit("data.mount");
|
||||
$server->shutdown;
|
||||
$server->start;
|
||||
$client1->succeed("touch /data/xyzzy");
|
||||
|
@ -20,16 +20,16 @@
|
||||
|
||||
my $key=`${pkgs.openssh}/bin/ssh-keygen -t dsa -f key -N ""`;
|
||||
|
||||
$server->waitForJob("sshd");
|
||||
$server->waitForUnit("sshd");
|
||||
|
||||
$server->mustSucceed("mkdir -m 700 /root/.ssh");
|
||||
$server->succeed("mkdir -m 700 /root/.ssh");
|
||||
$server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");
|
||||
|
||||
$client->mustSucceed("mkdir -m 700 /root/.ssh");
|
||||
$client->succeed("mkdir -m 700 /root/.ssh");
|
||||
$client->copyFileFromHost("key", "/root/.ssh/id_dsa");
|
||||
$client->mustSucceed("chmod 600 /root/.ssh/id_dsa");
|
||||
$client->succeed("chmod 600 /root/.ssh/id_dsa");
|
||||
|
||||
$client->waitForJob("network.target");
|
||||
$client->mustSucceed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world' >&2");
|
||||
$client->waitForUnit("network.target");
|
||||
$client->succeed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world' >&2");
|
||||
'';
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
''
|
||||
# The `portmap' service must be registered once for TCP and once for
|
||||
# UDP.
|
||||
$machine->mustSucceed("test `rpcinfo -p | grep portmapper | wc -l` -eq 2");
|
||||
$machine->succeed("test `rpcinfo -p | grep portmapper | wc -l` -eq 2");
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -62,33 +62,33 @@ in
|
||||
''
|
||||
startAll;
|
||||
|
||||
$proxy->waitForJob("httpd");
|
||||
$backend1->waitForJob("httpd");
|
||||
$backend2->waitForJob("httpd");
|
||||
$proxy->waitForUnit("httpd");
|
||||
$backend1->waitForUnit("httpd");
|
||||
$backend2->waitForUnit("httpd");
|
||||
|
||||
# With the back-ends up, the proxy should work.
|
||||
$client->mustSucceed("curl --fail http://proxy/");
|
||||
$client->succeed("curl --fail http://proxy/");
|
||||
|
||||
$client->mustSucceed("curl --fail http://proxy/server-status");
|
||||
$client->succeed("curl --fail http://proxy/server-status");
|
||||
|
||||
# Block the first back-end.
|
||||
$backend1->block;
|
||||
|
||||
# The proxy should still work.
|
||||
$client->mustSucceed("curl --fail http://proxy/");
|
||||
$client->succeed("curl --fail http://proxy/");
|
||||
|
||||
$client->mustSucceed("curl --fail http://proxy/");
|
||||
$client->succeed("curl --fail http://proxy/");
|
||||
|
||||
# Block the second back-end.
|
||||
$backend2->block;
|
||||
|
||||
# Now the proxy should fail as well.
|
||||
$client->mustFail("curl --fail http://proxy/");
|
||||
$client->fail("curl --fail http://proxy/");
|
||||
|
||||
# But if the second back-end comes back, the proxy should start
|
||||
# working again.
|
||||
$backend2->unblock;
|
||||
$client->mustSucceed("curl --fail http://proxy/");
|
||||
$client->succeed("curl --fail http://proxy/");
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ rec {
|
||||
''
|
||||
startAll;
|
||||
|
||||
$server->waitForJob("quake3-server");
|
||||
$server->waitForUnit("quake3-server");
|
||||
$client1->waitForX;
|
||||
$client2->waitForX;
|
||||
|
||||
|
@ -66,33 +66,33 @@ in
|
||||
|
||||
$webserver->waitForOpenPort(80);
|
||||
|
||||
print STDERR $client->mustSucceed("svn --version");
|
||||
print STDERR $client->succeed("svn --version");
|
||||
|
||||
print STDERR $client->mustSucceed("curl --fail http://webserver/");
|
||||
print STDERR $client->succeed("curl --fail http://webserver/");
|
||||
|
||||
# Create a new user through the web interface.
|
||||
$client->mustSucceed("curl --fail -F username=alice -F fullname='Alice Lastname' -F address=alice\@example.org -F password=foobar -F password_again=foobar http://webserver/repoman/adduser");
|
||||
$client->succeed("curl --fail -F username=alice -F fullname='Alice Lastname' -F address=alice\@example.org -F password=foobar -F password_again=foobar http://webserver/repoman/adduser");
|
||||
|
||||
# Let Alice create a new repository.
|
||||
$client->mustSucceed("curl --fail -u alice:foobar --form repo=xyzzy --form description=Xyzzy http://webserver/repoman/create");
|
||||
$client->succeed("curl --fail -u alice:foobar --form repo=xyzzy --form description=Xyzzy http://webserver/repoman/create");
|
||||
|
||||
$client->mustSucceed("curl --fail http://webserver/") =~ /alice/ or die;
|
||||
$client->succeed("curl --fail http://webserver/") =~ /alice/ or die;
|
||||
|
||||
# Let Alice do a checkout.
|
||||
my $svnFlags = "--non-interactive --username alice --password foobar";
|
||||
$client->mustSucceed("svn co $svnFlags http://webserver/repos/xyzzy wc");
|
||||
$client->mustSucceed("echo hello > wc/world");
|
||||
$client->mustSucceed("svn add wc/world");
|
||||
$client->mustSucceed("svn ci $svnFlags -m 'Added world.' wc/world");
|
||||
$client->succeed("svn co $svnFlags http://webserver/repos/xyzzy wc");
|
||||
$client->succeed("echo hello > wc/world");
|
||||
$client->succeed("svn add wc/world");
|
||||
$client->succeed("svn ci $svnFlags -m 'Added world.' wc/world");
|
||||
|
||||
# Create a new user on the server through the create-user.pl script.
|
||||
$webserver->execute("svn-server-create-user.pl bob bob\@example.org Bob");
|
||||
$webserver->mustSucceed("svn-server-resetpw.pl bob fnord");
|
||||
$client->mustSucceed("curl --fail http://webserver/") =~ /bob/ or die;
|
||||
$webserver->succeed("svn-server-resetpw.pl bob fnord");
|
||||
$client->succeed("curl --fail http://webserver/") =~ /bob/ or die;
|
||||
|
||||
# Bob should not have access to the repo.
|
||||
my $svnFlagsBob = "--non-interactive --username bob --password fnord";
|
||||
$client->mustFail("svn co $svnFlagsBob http://webserver/repos/xyzzy wc2");
|
||||
$client->fail("svn co $svnFlagsBob http://webserver/repos/xyzzy wc2");
|
||||
|
||||
# Bob should not be able change the ACLs of the repo.
|
||||
# !!! Repoman should really return a 403 here.
|
||||
@ -100,15 +100,15 @@ in
|
||||
=~ /not authorised/ or die;
|
||||
|
||||
# Give Bob access.
|
||||
$client->mustSucceed("curl --fail -u alice:foobar -F description=Xyzzy -F readers=alice,bob -F writers=alice -F watchers= -F tardirs= http://webserver/repoman/update/xyzzy");
|
||||
$client->succeed("curl --fail -u alice:foobar -F description=Xyzzy -F readers=alice,bob -F writers=alice -F watchers= -F tardirs= http://webserver/repoman/update/xyzzy");
|
||||
|
||||
# So now his checkout should succeed.
|
||||
$client->mustSucceed("svn co $svnFlagsBob http://webserver/repos/xyzzy wc2");
|
||||
$client->succeed("svn co $svnFlagsBob http://webserver/repos/xyzzy wc2");
|
||||
|
||||
# Test ViewVC and WebSVN
|
||||
$client->mustSucceed("curl --fail -u alice:foobar http://webserver/viewvc/xyzzy");
|
||||
$client->mustSucceed("curl --fail -u alice:foobar http://webserver/websvn/xyzzy");
|
||||
$client->mustSucceed("curl --fail -u alice:foobar http://webserver/repos-xml/xyzzy");
|
||||
$client->succeed("curl --fail -u alice:foobar http://webserver/viewvc/xyzzy");
|
||||
$client->succeed("curl --fail -u alice:foobar http://webserver/websvn/xyzzy");
|
||||
$client->succeed("curl --fail -u alice:foobar http://webserver/repos-xml/xyzzy");
|
||||
|
||||
# Stop Apache to gather all the coverage data.
|
||||
$webserver->stopJob("httpd");
|
||||
|
@ -23,9 +23,9 @@
|
||||
testScript = ''
|
||||
startAll;
|
||||
|
||||
$server->waitForJob("tomcat");
|
||||
$server->waitForUnit("tomcat");
|
||||
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
|
||||
$client->waitForJob("network.target");
|
||||
$client->waitForUnit("network.target");
|
||||
$client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
|
||||
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
|
||||
'';
|
||||
|
@ -55,15 +55,15 @@
|
||||
''
|
||||
startAll;
|
||||
|
||||
$postgresql->waitForJob("postgresql");
|
||||
$postgresql->mustSucceed("createdb trac");
|
||||
$postgresql->waitForUnit("postgresql");
|
||||
$postgresql->succeed("createdb trac");
|
||||
|
||||
$webserver->mustSucceed("mkdir -p /repos/trac");
|
||||
$webserver->mustSucceed("svnadmin create /repos/trac");
|
||||
$webserver->succeed("mkdir -p /repos/trac");
|
||||
$webserver->succeed("svnadmin create /repos/trac");
|
||||
|
||||
$webserver->waitForFile("/var/trac");
|
||||
$webserver->mustSucceed("mkdir -p /var/trac/projects/test");
|
||||
$webserver->mustSucceed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac");
|
||||
$webserver->succeed("mkdir -p /var/trac/projects/test");
|
||||
$webserver->succeed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac");
|
||||
|
||||
$client->waitForX;
|
||||
$client->execute("konqueror http://webserver/projects/test &");
|
||||
|
Loading…
Reference in New Issue
Block a user