Author: sandervanderburg
Date: Tue Jan 24 22:19:05 2012
New Revision: 31830
URL: https://nixos.org/websvn/nix/?rev=31830&sc=1

Log:
By breaking up the NixOS network configurations, the VM testing stuff no longer 
takes the QEMU properties into account. Fixed this

Modified:
   disnix/disnixos/trunk/data/generate-infrastructure.nix.in
   disnix/disnixos/trunk/data/infrastructure.nix.in
   disnix/disnixos/trunk/doc/manual/disnixos-geninfra.xml
   disnix/disnixos/trunk/scripts/disnixos-geninfra.in
   disnix/disnixos/trunk/scripts/disnixos-vm-env.in

Modified: disnix/disnixos/trunk/data/generate-infrastructure.nix.in
==============================================================================
--- disnix/disnixos/trunk/data/generate-infrastructure.nix.in   Tue Jan 24 
22:09:17 2012        (r31829)
+++ disnix/disnixos/trunk/data/generate-infrastructure.nix.in   Tue Jan 24 
22:19:05 2012        (r31830)
@@ -1,5 +1,6 @@
 { networkFiles
 , useBackdoor ? false
+, useVMTesting ? false
 , nixpkgs ? <nixpkgs>
 , nixos ? <nixos>
 }:
@@ -13,7 +14,9 @@
   buildCommand = ''
     sed -e "s|@networkFiles@|${toString networkFiles}|" \
         -e "s|@nixpkgs@|${nixpkgs}|" \
-       -e "s|@nixos@|${nixos}|" \
-       -e "s|@useBackdoor@|${if useBackdoor then "true" else "false"}|" 
${infrastructureNix} > $out
+        -e "s|@nixos@|${nixos}|" \
+        -e "s|@useBackdoor@|${if useBackdoor then "true" else "false"}|" \
+        -e "s|@useVMTesting@|${if useVMTesting then "true" else "false"}|" \
+        ${infrastructureNix} > $out
   '';
 }

Modified: disnix/disnixos/trunk/data/infrastructure.nix.in
==============================================================================
--- disnix/disnixos/trunk/data/infrastructure.nix.in    Tue Jan 24 22:09:17 
2012        (r31829)
+++ disnix/disnixos/trunk/data/infrastructure.nix.in    Tue Jan 24 22:19:05 
2012        (r31830)
@@ -3,6 +3,7 @@
   nixpkgs = "@nixpkgs@";
   nixos = "@nixos@";
   useBackdoor = @useBackdoor@;
+  useVMTesting = @useVMTesting@;
 
   pkgs = import nixpkgs {};
   
@@ -22,9 +23,11 @@
          networking.hostName = targetName;
        }
       ]
+      ++ pkgs.lib.optional useVMTesting 
"${nixos}/modules/virtualisation/qemu-vm.nix"
+      ++ pkgs.lib.optional useVMTesting 
"${nixos}/modules/testing/test-instrumentation.nix"
       ++ pkgs.lib.optional useBackdoor {
         key = "backdoor";
-       services.disnix.infrastructure.backdoor = "TCP:${targetName}:512";
+        services.disnix.infrastructure.backdoor = "TCP:${targetName}:512";
       };
       extraArgs = configurations;
     }).config) network;

Modified: disnix/disnixos/trunk/doc/manual/disnixos-geninfra.xml
==============================================================================
--- disnix/disnixos/trunk/doc/manual/disnixos-geninfra.xml      Tue Jan 24 
22:09:17 2012        (r31829)
+++ disnix/disnixos/trunk/doc/manual/disnixos-geninfra.xml      Tue Jan 24 
22:19:05 2012        (r31830)
@@ -47,6 +47,14 @@
                                </listitem>
                        </varlistentry>
                        <varlistentry>
+                               <term><option>--use-vm-testing</option></term>
+                               <listitem>
+                                       <para>
+                                               Indicates that we want to use 
the NixOS VM testing features, so that their relevant properties are taken into 
account.
+                                       </para>
+                               </listitem>
+                       </varlistentry>
+                       <varlistentry>
                                <term><option>--no-out-link</option></term>
                                <listitem>
                                        <para>

Modified: disnix/disnixos/trunk/scripts/disnixos-geninfra.in
==============================================================================
--- disnix/disnixos/trunk/scripts/disnixos-geninfra.in  Tue Jan 24 22:09:17 
2012        (r31829)
+++ disnix/disnixos/trunk/scripts/disnixos-geninfra.in  Tue Jan 24 22:19:05 
2012        (r31830)
@@ -23,10 +23,11 @@
     echo "Usage: $0 [options] network_expr"
     echo "Options:"
     echo
-    echo "--no-out-link  Do not create a 'result' symlink"
-    echo "--use-backdoor Indicates that the backdoor must be enabled so that 
the VMs can be accessed through a socket"
-    echo "--show-trace   Shows a trace of the output"
-    echo "-h,--help      Shows the usage of this command"
+    echo "--no-out-link    Do not create a 'result' symlink"
+    echo "--use-backdoor   Indicates that the backdoor must be enabled so that 
the VMs can be accessed through a socket"
+    echo "--use-vm-testing Indicates that we generate virtual machines, so 
that the physical characteristics are automatically added"
+    echo "--show-trace     Shows a trace of the output"
+    echo "-h,--help        Shows the usage of this command"
 }
 
 # Autoconf settings
@@ -37,7 +38,7 @@
 
 # Parse valid argument options
 
-PARAMS=`getopt -n $0 -o h -l no-out-link,use-backdoor,show-trace,help -- "$@"`
+PARAMS=`getopt -n $0 -o h -l 
no-out-link,use-backdoor,use-vm-testing,show-trace,help -- "$@"`
 
 if [ $? != 0 ]
 then
@@ -58,6 +59,9 @@
        --use-backdoor)
            useBackdoor=1
            ;;
+       --use-vm-testing)
+           useVMTesting=1
+           ;;
        --show-trace)
            showTrace=1
            ;;
@@ -82,6 +86,11 @@
     useBackdoorArg="--arg useBackdoor true"
 fi
 
+if [ "$useVMTesting" = "1" ]
+then
+    useVMTesting="--arg useVMTesting true"
+fi
+
 if [ "$@" = "" ]
 then
     echo "ERROR: A network expression must be specified!" >&2
@@ -95,4 +104,4 @@
 fi
 
 # Execute operation
-nix-build @datadir@/@PACKAGE@/generate-infrastructure.nix --arg networkFiles 
"[ $networkFiles ]" $useBackdoorArg $showTraceArg $noOutLinkArg
+nix-build @datadir@/@PACKAGE@/generate-infrastructure.nix --arg networkFiles 
"[ $networkFiles ]" $useBackdoorArg $useVMTesting $showTraceArg $noOutLinkArg

Modified: disnix/disnixos/trunk/scripts/disnixos-vm-env.in
==============================================================================
--- disnix/disnixos/trunk/scripts/disnixos-vm-env.in    Tue Jan 24 22:09:17 
2012        (r31829)
+++ disnix/disnixos/trunk/scripts/disnixos-vm-env.in    Tue Jan 24 22:19:05 
2012        (r31830)
@@ -94,7 +94,7 @@
 vmsPath=`nixos-build-vms --no-out-link $showTraceArg $networkFiles`
 
 # Generate infrastructure expression from network expression
-infrastructureFile=`disnixos-geninfra --use-backdoor --no-out-link 
$showTraceArg $networkFiles`
+infrastructureFile=`disnixos-geninfra --use-backdoor --use-vm-testing 
--no-out-link $showTraceArg $networkFiles`
 
 # Build the manifest
 manifest=`disnix-manifest -s $servicesFile -i $infrastructureFile -d 
$distributionFile --target-property backdoor --no-out-link $showTraceArg`
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to