]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
TestSupport: introduce hostprop_putative_record
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 28 Jul 2017 14:59:41 +0000 (15:59 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Oct 2017 11:04:31 +0000 (12:04 +0100)
This is used to store tentative host properties in the runvars of a
job, with the expectation that at some point (ie: at the end of the
job) they will be turned into real properties stored in the database.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v2:
 - Use the following runvar format to store the putative host props:
   hostprop/$ident/$prop=$val.

Osstest/TestSupport.pm

index 9d67c530382f38220c40c2fdaeab755b50d81469..6d5e667844ec0394e2371344c3333a9dde1dfb06 100644 (file)
@@ -82,6 +82,7 @@ BEGIN {
                       power_state power_cycle power_cycle_sleep
                       serial_fetch_logs set_host_property
                       propname_massage propname_check
+                      hostprop_putative_record
          
                       get_stashed open_unique_stashfile compress_stashed
                       dir_identify_vcs
@@ -1156,6 +1157,12 @@ sub set_host_property ($$$) {
     $mhostdb->set_property($ho, $prop, $val);
 }
 
+sub hostprop_putative_record ($$$) {
+    my ($ho, $prop, $val) = @_;
+
+    store_runvar("hostprop/$ho->{Ident}/$prop", $val);
+}
+
 sub get_target_property ($$;$);
 sub get_target_property ($$;$) {
     my ($ho, $prop, $defval) = @_;