[gnome-hwtest] Add a --simulator option to gnome-hwtest-install



commit 3a42a991b810e24dfaa3bd2f3b73b4d5c4dadfbd
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Sep 21 12:26:52 2014 -0400

    Add a --simulator option to gnome-hwtest-install
    
    --simulator can be combined with --controller to do the
    initial setup for a controller system running under
    gnome-hwtest-simulator.
    
    Remove the obsolete gnome-hwtest-initialize-repo script.

 src/gnome-hwtest-initialize-repo |    6 ------
 src/gnome-hwtest-install         |   25 +++++++++++++++++++++++--
 2 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/src/gnome-hwtest-install b/src/gnome-hwtest-install
index 2561df3..cc98db9 100755
--- a/src/gnome-hwtest-install
+++ b/src/gnome-hwtest-install
@@ -222,11 +222,24 @@ function install_to_device() {
         else
             repo=$hwtestdir/repo
             ostree --repo=$repo init --mode=archive-z2
-            ostree --repo=$repo remote add gnome-continuous https://build.gnome.org/repo
+            if $simulator ; then
+                ostree --repo=$repo remote add gnome-continuous http://10.0.2.100/repo --no-gpg-verify
+            else
+                ostree --repo=$repo remote add gnome-continuous https://build.gnome.org/repo
+            fi
         fi
 
         if [ -e $hwtestdir/controller.conf ] ; then
             echo "/srv/gnome-hwtest/controller.conf already exists"
+        elif $simulator ; then
+            echo > $hwtestdir/controller.conf <<EOF
+[controller]
+private_hwaddr=52:54:00:12:34:56
+public_hwaddr=52:54:00:12:34:58
+upstream_repo=http://10.0.2.100/repo
+perf_server_api=http://10.0.2.101/api
+hwtest_tree=gnome-continuous/buildmaster/x86_64-hwtest
+EOF
         else
             cat > $hwtestdir/controller.conf <<EOF
 [controller]
@@ -247,19 +260,27 @@ EOF
 ########################################
 
 controller=false
+simulator=false
 device=
 while [ $# '>' 0 ] ; do
     if [ "$1" == '--controller' ] ; then
         controller=true;
+    elif [ "$1" == '--simulator' ] ; then
+        simulator=true
     elif [ -z "$device" ] ; then
         device=$1
     else
-        echo 1>&2 "Usage: gnome-hwtest-install [--controller] [target_device]"
+        echo 1>&2 "Usage: gnome-hwtest-install [--controller] [--simulator] [target_device]"
         exit 1
     fi
     shift
 done
 
+if $simulator && ! $controller ; then
+    echo 1>&2 "--simulator option only makes sense with --controller"
+    exit 1
+fi
+
 if [ -z "$device" ] ; then
     device=`get_device`
 else


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