]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
rump kernel tests: Cancel unneeded edits of guest config
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 6 Feb 2015 17:08:31 +0000 (17:08 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 13 Feb 2015 14:01:46 +0000 (14:01 +0000)
If the guest config is already set up to preserve, cancel the edit.
We are going to repeat this test, and this avoids creating many
identical copies of the same file in the log output.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbelL@citrix.com>
ts-rumpuserxen-demo-xenstorels

index ed46843eb3e9d7ce07990287e8819b9a1a82c671..a54fbf4d88f0a0ca68277b4e4255c2481e35fd75 100755 (executable)
@@ -32,7 +32,11 @@ our $gn = $gho->{Guest};
 sub arrangepreserve () {
     target_editfile_root($ho,$r{"$gho->{Guest}_cfgpath"}, sub {
        while (<EI>) {
-           next if m/^\s*on_poweroff\s*=/;
+           if (m/^\s*on_poweroff\s*=/) {
+               target_editfile_cancel("already configured to preserve")
+                   if m/\bpreserve\b/;
+               next;
+           }
            print EO or die $!;
        }
        print EO "\n","on_poweroff='preserve'\n" or die $!;