From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [OSSTest PATCH [RFC] 1/4] Introducing Osstest/Fedora.pm Date: Thu, 12 Dec 2013 23:53:25 +0100 Message-ID: <20131212225324.11164.40939.stgit@Solace> References: <20131212221933.11164.46804.stgit@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131212221933.11164.46804.stgit@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org which, for now, only handles the kickstart files (the equivalent of d-i preseeds). Signed-off-by: Dario Faggioli --- 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 . + + +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.= (< /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:///debian/ +FedoraMirrorHost + Domain name or address of the Fedora mirror to use. + Set FedoraMirrorSubpath to the path inside the mirror. + http://// should + point to where 'releases' and/or 'development' directory + are. + TestHost TestHost_ 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