[node-patches] Change in ovirt-node[master]: tools: Add testable-node tool

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri May 3 10:02:40 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: tools: Add testable-node tool
......................................................................

tools: Add testable-node tool

This tool can be used to add the igor slave to an existing iso image.

Change-Id: I72b09cdeb2db655d175a5bc92c5bc2a6fad1ec07
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
A tools/testable-node
1 file changed, 87 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/97/14397/1

diff --git a/tools/testable-node b/tools/testable-node
new file mode 100644
index 0000000..85ff5c7
--- /dev/null
+++ b/tools/testable-node
@@ -0,0 +1,87 @@
+#!/bin/bash
+#
+# testable-node Copyright (C) 2012 Red Hat, Inc.
+# Written by Fabian Deutsch <fabiand at fedoraproject.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.  A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+isoname=""
+verbose=""
+
+IGORPLUGIN=ovirt-node-plugin-igor-slave
+
+
+
+show_usage()
+{
+    echo "Usage: $0 [-v] -i <isoname>"
+    echo " -i    ISO file to be edited"
+    echo " -v    Be verbose"
+    echo ""
+    echo "$0 can be used to add the $IGORPLUGIN to a "
+    echo "given ISO so it can be tested within an igor setup."
+    echo ""
+}
+
+die()
+{
+    echo -e "\nERROR: $@\n" >&2
+    show_usage
+    exit 1
+}
+
+_parse_opts()
+{
+    while getopts "h?vi:" opt;
+    do
+        case "$opt" in
+        h|\?)
+            show_usage
+            exit 0
+            ;;
+        v)  verbose="-v -d"
+            ;;
+        i)  isoname=$OPTARG
+            ;;
+        esac
+    done
+
+    [[ -z "$ISONAME" ]] && die "<isoname> is missing"
+
+    shift $((OPTIND-1))
+
+    [[ "$1" = "--" ]] && shift
+}
+
+main()
+{
+    TMPREPO=igor.repo
+
+    _parse_opts
+
+    cmds="s/^\[/\[igor-/ ; /^mirrorlist/d ; s/^#base/base/ ; s/https:/http:/"
+    sed "$cmds" /etc/yum.repos.d/*.repo > $TMPREPO
+
+    sudo ./edit-node $verbose \
+      --repo $TMPREPO \
+      --install $IGORPLUGIN \
+      --nogpgcheck \
+      "$isoname"
+
+    unlink $TMPREPO
+}
+
+main
\ No newline at end of file


--
To view, visit http://gerrit.ovirt.org/14397
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72b09cdeb2db655d175a5bc92c5bc2a6fad1ec07
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list