[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTest PATCH [RFC] 1/4] Introducing Osstest/Fedora.pm



which, for now, only handles the kickstart files (the
equivalent of d-i preseeds).

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
---
 Osstest.pm                |    4 ++
 Osstest/Fedora.pm         |   83 +++++++++++++++++++++++++++++++++++++++++++++
 README                    |    9 +++++
 standalone-config-example |    2 +
 4 files changed, 98 insertions(+)
 create mode 100644 Osstest/Fedora.pm

diff --git a/Osstest.pm b/Osstest.pm
index 9ba2882..1cc5acb 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -62,6 +62,8 @@ our %c = qw(
     DebianSuite squeeze
     DebianMirrorSubpath debian
 
+    FedoraMirrorSubpath fedora/linux
+
     TestHostKeypairPath id_rsa_osstest
     HostProp_GenEtherPrefixBase 5e:36:0e:f5
 
@@ -179,6 +181,8 @@ sub readglobalconfig () {
     $c{OverlayLocal} ||= "overlay-local";
     $c{GuestDebianSuite} ||= $c{DebianSuite};
 
+    $c{GuestFedoraRelease} ||= 19;
+
     $c{DefaultBranch} ||= 'xen-unstable';
 }
 
diff --git a/Osstest/Fedora.pm b/Osstest/Fedora.pm
new file mode 100644
index 0000000..a5c7cec
--- /dev/null
+++ b/Osstest/Fedora.pm
@@ -0,0 +1,83 @@
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+package Osstest::Fedora;
+
+use strict;
+use warnings;
+
+use IO::File;
+use File::Copy;
+
+use Osstest;
+use Osstest::TestSupport;
+
+BEGIN {
+    use Exporter ();
+    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+    $VERSION     = 1.00;
+    @ISA         = qw(Exporter);
+    @EXPORT      = qw(kickstart_create);
+    %EXPORT_TAGS = ( );
+
+    @EXPORT_OK   = qw();
+}
+
+#---------- installation of Fedora via kickstart file ----------
+
+sub kickstart_create($$$) {
+    my ($ho, $repourl, $sfx) = @_;
+
+    my $ks_file.= (<<END);
+install
+firewall --disabled
+keyboard 'us'
+reboot
+rootpw --plaintext xenroot
+timezone Europe/London --isUtc
+lang en_US
+auth --useshadow --passalgo=sha512
+text # text mode install
+selinux --permissive
+skipx
+
+url --url="$repourl"
+network  --bootproto=dhcp --device=eth0
+
+bootloader --location=mbr
+zerombr
+clearpart --all
+part swap --asprimary --fstype="swap" --size=1000
+part / --asprimary --fstype="ext4" --grow --size=1
+
+\%packages
+\@admin-tools
+\@standard
+\%end
+
+\%post
+exec < /dev/console > /dev/console
+echo "# Adding osstest user"
+useradd -p \`openssl passwd -1 osstest\` osstest
+echo "# Upgrading the system"
+yum -y upgrade
+\%end
+END
+    return create_webfile($ho, "ks$sfx", $ks_file);
+}
+
+1;
diff --git a/README b/README
index 29c9d45..c2ce2c1 100644
--- a/README
+++ b/README
@@ -89,6 +89,13 @@ DebianMirrorHost
    Set DebianMirrorSubpath to the path inside the mirror if
    your mirror isn't at http://<DebianMirrorHost>/debian/
 
+FedoraMirrorHost
+   Domain name or address of the Fedora mirror to use.
+   Set FedoraMirrorSubpath to the path inside the mirror.
+   http://<FedoraMirrorHost>/<FedoraMirrorSubpath>/ should
+   point to where 'releases' and/or 'development' directory
+   are.
+
 TestHost <hostname>
 TestHost_<ident> <hostname>
    Specifies the test box to use.  Should be a bare hostname,
@@ -191,6 +198,8 @@ GuestDebianSuite   defaults to DebianSuite
 
 DebianPreseed      added to existing preseed file
 
+GuestFedoraRelease defaults to 19
+
 TftpPxeTemplates
     List (space-separated) of template filenames for writing
     The templates contain variable substitutions %var%
diff --git a/standalone-config-example b/standalone-config-example
index 9b2b79b..2bc18f7 100644
--- a/standalone-config-example
+++ b/standalone-config-example
@@ -26,6 +26,8 @@ HostProp_DhcpWatchMethod leases dhcp3 
dhcp.uk.xensource.com:5556
 TftpPath /usr/groups/netboot/
 
 DebianMirrorHost debian.uk.xensource.com
+FedoraMirrorHost dl.fedoraproject.org
+FedoraMirrorSubpath pub/fedora/linux
 
 DebianPreseed= <<'END'
 d-i clock-setup/ntp-server string ntp.uk.xensource.com


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.