Commit 600e4949 authored by Sergei Golubchik's avatar Sergei Golubchik

mtr: fix the check where a combination is pre-selected

if all options from a combination from the combinations file are already
present in the server's list of options, then don't try to run tests
in other combinations from this file.

old behavior was: if at least one option from a combination is
already present in the list...
parent fe2a7048
...@@ -140,24 +140,16 @@ sub diff { ...@@ -140,24 +140,16 @@ sub diff {
} }
sub is_set { sub is_subset {
my ($opts, $set_opts)= @_; my ($set, $subset)= @_;
my %cache = map { _split_option($_) } @$set;
foreach my $opt (@$opts){ for (@$subset){
my ($name, $value)= _split_option($_);
my ($opt_name1, $value1)= _split_option($opt); return 0 unless exists $cache{$name} and $cache{$name} eq $value;
foreach my $set_opt (@$set_opts){
my ($opt_name2, $value2)= _split_option($set_opt);
if ($opt_name1 eq $opt_name2 and $value1 eq $value2){
# Option already set
return 1;
}
}
} }
return 0; return 1;
} }
......
...@@ -623,8 +623,10 @@ sub make_combinations($$@) ...@@ -623,8 +623,10 @@ sub make_combinations($$@)
{ {
# Skip all other combinations if the values they change # Skip all other combinations if the values they change
# are already fixed in master_opt or slave_opt # are already fixed in master_opt or slave_opt
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) && # (empty combinations are not considered a subset of anything)
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){ if (@{$comb->{comb_opt}} &&
My::Options::is_subset($test->{master_opt}, $comb->{comb_opt}) &&
My::Options::is_subset($test->{slave_opt}, $comb->{comb_opt}) ){
$test_combs->{$comb->{name}} = 2; $test_combs->{$comb->{name}} = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment