[node-patches] Change in ovirt-node[master]: testable-node: Retieve repofile via URL

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Jul 18 15:50:26 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: testable-node: Retieve repofile via URL
......................................................................

testable-node: Retieve repofile via URL

The tool can now also retrieve repofiles directly from an URL.

Change-Id: Id467c91281135dc38901d4424c633deb9ab2125b
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M tools/testable-node
1 file changed, 30 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/90/17090/1

diff --git a/tools/testable-node b/tools/testable-node
index 8be669e..b5cf688 100755
--- a/tools/testable-node
+++ b/tools/testable-node
@@ -31,17 +31,22 @@
 
 show_usage()
 {
+    echo ""
     echo "Usage: $0 [-vdt] [-r <.repo-file>] [-a <url>] -i <isoname>"
     echo " -i    ISO file to be edited"
     echo " -v    Be verbose"
-    echo " -r    Additional .repo file"
+    echo " -r    Additional .repo file (path or URL to a .repo file)"
     echo " -d    Dry - don't execute edit-node"
     echo " -t    Igor testplan to run on edited iso (if igorc is available)"
     echo " -a    With -t: URL of the igor host"
     echo "       (e.g. http://192.168.122.1:8080)"
     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 "$0 adds the $IGORPLUGIN to an ISO so it can be tested with Igor."
+    echo "$0 needs to be run as root."
+    echo ""
+    echo "Example:"
+    echo "$0 -v -i ovirt-node-iso-3.0.0-5.0.1.fc18.iso \\"
+    echo "   -r http://resources.ovirt.org/releases/node-base/edit-node.repo"
     echo ""
 }
 
@@ -82,7 +87,7 @@
         esac
     done
 
-    [[ -e "$isoname" ]] || die "<isoname> is missing or does not exist"
+    [[ -e "$isoname" ]] || die "<isoname> ('$isoname') is missing or does not exist"
     [[ "$testplanname" && -z "$igorurl" ]] && die "Igor URL is missing"
 
     shift $((OPTIND-1))
@@ -98,12 +103,14 @@
 
     check_os_compatibility
 
-    log "Generating temporary repository file: $TMPREPO"
-    cmds="s/^\[/\[igor-/ ; /^mirrorlist/d ; s/^#base/base/ ; s/https:/http:/"
-    sed "$cmds" /etc/yum.repos.d/*.repo $reponame > $TMPREPO
+    if [[ -n $reponame ]];
+    then
+        log "Generating temporary repository file: $TMPREPO"
+        create_repofile
+    fi
 
     ARGS="$verbose "
-    ARGS+="--repo $TMPREPO "
+    [[ -n $reponame ]] && ARGS+="--repo $TMPREPO "
     ARGS+="--install $IGORPLUGIN "
     ARGS+="--nogpgcheck "
     ARGS+="$isoname"
@@ -132,6 +139,21 @@
     [[ $ISORELEASE -eq $VERSION_ID ]] || die "OS and ISO don't match."
 }
 
+create_repofile()
+{
+    if echo $reponame | egrep -q "http://.*\.repo";
+    then
+        log "Given repo is a URL, fetching from '$reponame' ..."
+        curl -# -O "$reponame"
+        reponame=$(basename $reponame)
+        log "Got '$reponame'"
+    fi
+    [[ ! -f $reponame ]] && die "Can't find repofile '$reponame'."
+    # FIXME once we ship cerst again we can also use https
+    cmds="s/^\[/\[igor-/ ; /^mirrorlist/d ; s/^#base/base/ ; s/https:/http:/"
+    sed -e "$cmds" $reponame > $TMPREPO
+}
+
 test_with_igor()
 {
     log "Running igor test on iso"


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id467c91281135dc38901d4424c633deb9ab2125b
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