Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package os-autoinst for openSUSE:Factory checked in at 2026-10-23 20:28:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/os-autoinst (Old) and /work/SRC/openSUSE:Factory/.os-autoinst.new.2252680 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-autoinst" Fri Oct 23 20:28:43 2026 rev:634 rq:1387219 version:5.1792683987.d65739f Changes: -------- --- /work/SRC/openSUSE:Factory/os-autoinst/os-autoinst.changes 2026-10-21 21:01:26.335935541 +0200 +++ /work/SRC/openSUSE:Factory/.os-autoinst.new.2252680/os-autoinst.changes 2026-10-23 20:29:48.200368234 +0200 @@ -1,0 +2,6 @@ +Thu Oct 22 15:46:48 UTC 2026 - [email protected] + +- Update to version 5.1792683987.d65739f: + * feat(testapi): Add a stash (key/value storage) + +------------------------------------------------------------------- Old: ---- os-autoinst-5.1792484351.82c2f16.obscpio New: ---- os-autoinst-5.1792683987.d65739f.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ os-autoinst-devel-test.spec ++++++ --- /var/tmp/diff_new_pack.695LcP/_old 2026-10-23 20:29:49.223411164 +0200 +++ /var/tmp/diff_new_pack.695LcP/_new 2026-10-23 20:29:49.225411248 +0200 @@ -18,7 +18,7 @@ %define short_name os-autoinst-devel Name: %{short_name}-test -Version: 5.1792484351.82c2f16 +Version: 5.1792683987.d65739f Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-openvswitch-test.spec ++++++ --- /var/tmp/diff_new_pack.695LcP/_old 2026-10-23 20:29:49.250412297 +0200 +++ /var/tmp/diff_new_pack.695LcP/_new 2026-10-23 20:29:49.251412339 +0200 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst-openvswitch Name: %{short_name}%{?name_ext} -Version: 5.1792484351.82c2f16 +Version: 5.1792683987.d65739f Release: 0 Summary: test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-test.spec ++++++ --- /var/tmp/diff_new_pack.695LcP/_old 2026-10-23 20:29:49.275413347 +0200 +++ /var/tmp/diff_new_pack.695LcP/_new 2026-10-23 20:29:49.277413431 +0200 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst Name: %{short_name}%{?name_ext} -Version: 5.1792484351.82c2f16 +Version: 5.1792683987.d65739f Release: 0 Summary: test package for os-autoinst License: GPL-2.0-or-later ++++++ os-autoinst.spec ++++++ --- /var/tmp/diff_new_pack.695LcP/_old 2026-10-23 20:29:49.305414606 +0200 +++ /var/tmp/diff_new_pack.695LcP/_new 2026-10-23 20:29:49.306414648 +0200 @@ -17,7 +17,7 @@ Name: os-autoinst -Version: 5.1792484351.82c2f16 +Version: 5.1792683987.d65739f Release: 0 Summary: OS-level test automation License: GPL-2.0-or-later ++++++ os-autoinst-5.1792484351.82c2f16.obscpio -> os-autoinst-5.1792683987.d65739f.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1792484351.82c2f16/t/03-testapi.t new/os-autoinst-5.1792683987.d65739f/t/03-testapi.t --- old/os-autoinst-5.1792484351.82c2f16/t/03-testapi.t 2026-10-20 10:19:11.000000000 +0200 +++ new/os-autoinst-5.1792683987.d65739f/t/03-testapi.t 2026-10-22 17:46:27.000000000 +0200 @@ -1456,6 +1456,28 @@ is $recorded_cmd, 'my_command', 'command passed to record_serialresult'; }; +subtest stash => sub { + my @diag; + $mock_bmwqemu->redefine(diag => sub ($msg) { push @diag, $msg }); + my $hash = bless {key => 23}, 'Some::Class'; + stash somename => $hash; + my $stored = stash 'somename'; + is $stored->{key}, 23, 'retrieving values via stash() works'; + + @diag = (); + debug_stash; + is $diag[0], <<~'EOM', 'debug_stash() works'; + testapi stash: + --- + somename: !perl/hash:Some::Class + key: 23 + EOM + + delete_stash 'somename'; + $stored = stash 'somename'; + is $stored, undef, 'delete_stash() values works'; +}; + done_testing; END { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1792484351.82c2f16/testapi.pm new/os-autoinst-5.1792683987.d65739f/testapi.pm --- old/os-autoinst-5.1792484351.82c2f16/testapi.pm 2026-10-20 10:19:11.000000000 +0200 +++ new/os-autoinst-5.1792683987.d65739f/testapi.pm 2026-10-22 17:46:27.000000000 +0200 @@ -43,6 +43,7 @@ %cmd get_var get_required_var check_var set_var get_var_array check_var_array autoinst_url + stash delete_stash debug_stash send_key send_key_until_needlematch type_string type_password enter_cmd @@ -2370,4 +2371,67 @@ sub set_serialdev ($new) { $serialdev = $new } +=head2 stash + + stash key_name => $data; + my $data = stash 'key_name'; + +Provides access to a Key/Value storage. Can be used to share data between +different test modules, that is not suitable to save via C<set_var>. +Pick a unique name, since every test module can write to this stash. + +You can save any kind of data structure. +Note that this is only stored in the process memory, so it is not +visible from a different process. + +You can save things that cannot be encoded with JSON: + + my $object = Some::Module->new(...); + stash my_object => $object; + # Other test module + my $object = stash 'my_object'; + $object->some_method; + stash('my_object')->some_method; + + my $regex = qr/foo|bar/; + stash match_something => $regex; + # Other test module + if ($string =~ stash('match_something')) { ... } + +=cut + +my %STASH; + +sub stash ($key, @value) { + return $STASH{$key} unless @value; + bmwqemu::diag("testapi::stash('$key' => ...)"); + $STASH{$key} = $value[0]; +} + +=head2 delete_stash + + delete_stash $key; + +Will delete the entry from the stash. + +=cut + +sub delete_stash ($key) { + bmwqemu::diag("testapi::delete_stash('$key')"); + delete $STASH{$key}; +} + +=head2 debug_stash + + debug_stash; + +Prints a YAML dump of the stash contents. + +=cut + +sub debug_stash () { + require YAML::PP::Perl; + bmwqemu::diag("testapi stash:\n" . YAML::PP::Perl::Dump(\%STASH)); +} + 1; ++++++ os-autoinst.obsinfo ++++++ --- /var/tmp/diff_new_pack.695LcP/_old 2026-10-23 20:29:50.750475245 +0200 +++ /var/tmp/diff_new_pack.695LcP/_new 2026-10-23 20:29:50.754475413 +0200 @@ -1,5 +1,5 @@ name: os-autoinst -version: 5.1792484351.82c2f16 -mtime: 1792484351 -commit: 82c2f16f64f0a38f9fe932524c90636826be875f +version: 5.1792683987.d65739f +mtime: 1792683987 +commit: d65739f82b142e3ea7c26d7b873ec5b80361ca8c
