Remove the Sys::Virt::TCK::NetworkHelpers::prepare_test_disk_and_vm
method and its helpers. All tests now use the virtbuilder based
images.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Build.PL | 1 -
conf/ks.cfg | 30 ---------
lib/Sys/Virt/TCK/NetworkHelpers.pm | 132 -------------------------------------
perl-Sys-Virt-TCK.spec.PL | 1 -
4 files changed, 164 deletions(-)
delete mode 100644 conf/ks.cfg
diff --git a/Build.PL b/Build.PL
index e682c3a..50f7499 100644
--- a/Build.PL
+++ b/Build.PL
@@ -110,7 +110,6 @@ my $b = $class->new(
},
conf_files => {
'conf/default.cfg' => 'conf/default.cfg',
- 'conf/ks.cfg' => 'conf/ks.cfg',
},
PL_files => [ 'perl-Sys-Virt-TCK.spec.PL' ],
);
diff --git a/conf/ks.cfg b/conf/ks.cfg
deleted file mode 100644
index b6269e9..0000000
--- a/conf/ks.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-install
-text
-url
--url=http://ftp-stud.hs-esslingen.de/Mirrors/fedora.redhat.com/linux/releases/17/Fedora/i386/os/
-lang en_US.UTF-8
-keyboard de-latin1-nodeadkeys
-network --device eth0 --bootproto dhcp
-rootpw --iscrypted
$6$AHEMvpa2rx3n/DON$toWNA/ainpreIRC1g2L9yuil7bS.2hIf8DomTluFGulQtN3KstPeVrmwFMhkwhsW7ud7DANsWycGEL5ZOU50e.
-firewall --service=ssh
-authconfig --enableshadow --passalgo=sha512 --enablefingerprint
-selinux --enforcing
-timezone --utc Europe/Berlin
-bootloader --location=mbr --driveorder=vda --append=" LANG=en_US.UTF-8
SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rhgb quiet"
-# The following is the partition information you requested
-# Note that any partitions you deleted are not expressed
-# here so unless you clear all partitions first, this is
-# not guaranteed to work
-clearpart --all --drives=vda --initlabel
-
-part /boot --fstype=ext4 --size=200
-part swap --grow --maxsize=256 --asprimary --size=1
-part / --fstype=ext3 --grow --size=200
-
-poweroff
-
-%packages
-@admin-tools
-@base
-@core
-@hardware-support
-%end
diff --git a/lib/Sys/Virt/TCK/NetworkHelpers.pm b/lib/Sys/Virt/TCK/NetworkHelpers.pm
index 5d19736..133064b 100644
--- a/lib/Sys/Virt/TCK/NetworkHelpers.pm
+++ b/lib/Sys/Virt/TCK/NetworkHelpers.pm
@@ -17,107 +17,7 @@ sub get_ip_from_leases{
return $ip;
}
-sub build_cdrom_ks_image {
- my $tck = shift;
- my $ks = $tck->config("ks");
-
- # Where we put the source files for the ISO
- my $bucket1 = "nwfilter-install-ks";
- # Where we put the ISO itself
- my $bucket2 = "nwfilter-install-iso";
-
- my $isoimage = catfile($tck->bucket_dir($bucket2), "boot.iso");
-
- unless (-e $isoimage) {
- my $isofiledir = $tck->bucket_dir($bucket1);
- my $ksfile = $tck->get_scratch_resource($ks, $bucket1, "ks.cfg");
- my @progs = `which mkisofs genisoimage`;
- chomp(@progs);
-
- `$progs[0] -o "$isoimage" $isofiledir`;
- }
-
- return ($isoimage, "cdrom:/ks.cfg");
-}
-
-sub build_domain{
- my $tck = shift;
- my $domain_name = shift;
- my $mode = @_ ? shift : "bridge";
-
- my $guest;
- my $mac = "52:54:00:11:11:11";
- my $model = "virtio";
- #my $filterref = "no-spoofing";
- my $filterref = "clean-traffic";
- my $network = "network";
- my $source = "default";
- my $dev = "eth2";
- my $virtualport;
-
- my ($cdrom, $ksurl) = build_cdrom_ks_image($tck);
-
- my $guest = $tck->generic_domain(name => $domain_name);
-
- # change the type of network connection for 802.1Qbg tests
- if ($mode eq "vepa") {
- $network ="direct";
- $virtualport = "802.1Qbg";
- }
-
- # We want a bigger disk than normal
- $guest->rmdisk();
- my $diskpath = $tck->create_sparse_disk("nwfilter",
"main.img", 5120);
- $guest->disk(src => $diskpath,
- dst => "vda",
- type=> "file");
-
- my $diskalloc = (stat $diskpath)[12];
-
- # No few blocks are allocated, then it likely hasn't been installed yet
- my $install = 0;
- if ($diskalloc < 10) {
- $install = 1;
- diag "Add cdrom";
- $guest->disk(src => $cdrom, dst=>"hdc",
- type=> "file", device => "cdrom");
- my $cmdline = "ip=dhcp gateway=192.168.122.1 ks=$ksurl";
- $guest->boot_cmdline($cmdline);
- $guest->interface(type => $network,
- source => $source,
- model => $model,
- mac => $mac);
- } else {
- diag "Do normal boot";
- $guest->clear_kernel_initrd_cmdline();
- if ($mode eq "vepa") {
- $guest->interface(type => $network,
- source => $source,
- model => $model,
- mac => $mac,
- dev => $dev,
- mode => $mode,
- virtualport => $virtualport);
- } else {
- $guest->interface(type => $network,
- source => $source,
- model => $model,
- mac => $mac,
- filterref => $filterref);
- }
- }
-
- # common configuration
- $guest->maxmem("1048576");
- $guest->memory("1048576");
- $guest->graphics(type => "vnc",
- port => "-1",
- autoport => "yes",
- listen => "127.0.0.1");
-
- return ($guest, $install);
-}
sub shutdown_vm_gracefully {
my $dom = shift;
@@ -132,36 +32,4 @@ sub shutdown_vm_gracefully {
diag ".. shutdown complete.. ";
}
-sub prepare_test_disk_and_vm{
- my $tck = shift;
- my $conn = shift;
- my $domain_name = shift;
- my $mode = @_ ? shift : "bridge";
-
- my ($guest, $need_install) = build_domain($tck, $domain_name, $mode);
- if ($need_install) {
- my $dom = $conn->define_domain($guest->as_xml);
- diag "Starting installation domain";
- $dom->create;
- diag "wait for installation to finish .. ";
- while($dom->is_active()) {
- sleep(10);
- diag ".. to view progress connect to virtual machine ${domain_name} .. ";
- }
- # cleanup install domain
- $dom->undefine;
- $dom = undef;
- sleep (10);
- diag " .. done";
- }
-
- ($guest, $need_install) = build_domain($tck, $domain_name, $mode);
- if ($need_install) {
- die "guest install appears to have failed";
- }
- # now the disk is installed and we can boot it
- my $dom = $conn->define_domain($guest->as_xml);
- return $dom;
-}
-
1;
diff --git a/perl-Sys-Virt-TCK.spec.PL b/perl-Sys-Virt-TCK.spec.PL
index 6986ea8..42b4324 100644
--- a/perl-Sys-Virt-TCK.spec.PL
+++ b/perl-Sys-Virt-TCK.spec.PL
@@ -112,7 +112,6 @@ rm -rf $RPM_BUILD_ROOT
#%doc INSTALL
%dir %{_sysconfdir}/libvirt-tck
%config(noreplace) %{_sysconfdir}/libvirt-tck/default.cfg
-%config(noreplace) %{_sysconfdir}/libvirt-tck/ks.cfg
%{_bindir}/libvirt-tck
%dir %{_datadir}/libvirt-tck
%{_datadir}/libvirt-tck/*
--
1.8.5.3