summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-19 02:44:31 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-19 02:44:31 +0100
commita71c3714323b6dce2fbeea68c2d007c223467f26 (patch)
tree3f1cb0fe8450ed460f7cb65113694d03ba064f08
parent35dd0b0f4ad6ab0d9365d2858b60bf82e4877bda (diff)
downloadsamba-a71c3714323b6dce2fbeea68c2d007c223467f26.tar.gz
samba-a71c3714323b6dce2fbeea68c2d007c223467f26.tar.bz2
samba-a71c3714323b6dce2fbeea68c2d007c223467f26.zip
Add framework for Kvm test.
(This used to be commit e4efbb2906f4f3876986e21c12b58791c3526bed)
-rwxr-xr-xsource4/selftest/selftest.pl14
-rw-r--r--source4/selftest/target/Kvm.pm55
2 files changed, 66 insertions, 3 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index aab2ca8f07..b6ce643eb3 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -13,7 +13,7 @@ selftest - Samba test runner
selftest --help
-selftest [--srcdir=DIR] [--builddir=DIR] [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--immediate] [--testlist=FILE] [TESTS]
+selftest [--srcdir=DIR] [--builddir=DIR] [--target=samba4|samba3|win|kvm] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--immediate] [--testlist=FILE] [TESTS]
=head1 DESCRIPTION
@@ -43,7 +43,7 @@ Change directory to run tests in. Default is 'st'.
Show errors as soon as they happen rather than at the end of the test run.
-=item I<--target samba4|samba3|win>
+=item I<--target samba4|samba3|win|kvm>
Specify test target against which to run. Default is 'samba4'.
@@ -280,7 +280,7 @@ Usage: $Script [OPTIONS] PREFIX
Generic options:
--help this help page
- --target=samba4|samba3|win Samba version to target
+ --target=samba[34]|win|kvm Samba version to target
--testlist=FILE file to read available tests from
Paths:
@@ -301,6 +301,9 @@ Samba4 Specific:
Samba3 Specific:
--bindir=PATH path to binaries
+Kvm Specific:
+ --image=PATH path to KVM image
+
Behaviour:
--quick run quick overall test
--one abort when the first test fails
@@ -334,6 +337,7 @@ my $result = GetOptions (
'resetup-environment' => \$opt_resetup_env,
'bindir:s' => \$opt_bindir,
'format=s' => \$opt_format,
+ 'image=s' => \$opt_image,
'testlist=s' => \@testlists
);
@@ -442,6 +446,10 @@ if ($opt_target eq "samba4") {
$testenv_default = "dc";
require target::Windows;
$target = new Windows();
+} elsif ($opt_target eq "kvm") {
+ require target::Kvm;
+ die("No image specified") unless ($opt_image);
+ $target = new Kvm($opt_image);
}
sub read_test_regexes($)
diff --git a/source4/selftest/target/Kvm.pm b/source4/selftest/target/Kvm.pm
new file mode 100644
index 0000000000..533fb302d0
--- /dev/null
+++ b/source4/selftest/target/Kvm.pm
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+# Start a KVM machine and run a number of tests against it.
+# Copyright (C) 2005-2008 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU GPL, v3 or later.
+
+package Kvm;
+
+use strict;
+use Cwd qw(abs_path);
+use FindBin qw($RealBin);
+use POSIX;
+
+sub new($$$$) {
+ my ($classname, $image) = @_;
+ my $self = {
+ image => $image
+ };
+ bless $self;
+ return $self;
+}
+
+sub teardown_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ return 0;
+}
+
+sub getlog_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ return "";
+}
+
+sub check_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ return 1;
+}
+
+sub setup_env($$$)
+{
+ my ($self, $envname, $path) = @_;
+
+ die("No implemented yet");
+}
+
+sub stop($)
+{
+ my ($self) = @_;
+}
+
+1;