Commit 74c21b9d authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add some ordering to the queries in BackupPhysicalState(), for the

regression testing.
parent ebe95ac5
......@@ -3124,11 +3124,20 @@ sub BackupPhysicalState($;$$)
if (@pnodenames) {
my $clause = join(" or ", map("node_id='$_'", @pnodenames));
foreach my $table ("vinterfaces", "interface_settings", "nodes") {
DBQueryWarn("select * from $table where $clause ".
"into outfile '$pstateDir/$table' ")
or $errors++;
}
DBQueryWarn("select * from nodes where $clause ".
"into outfile '$pstateDir/nodes' ")
or $errors++;
# This ordering is for wrapper/mapper regression testing.
DBQueryWarn("select * from vinterfaces where $clause ".
"order by node_id,unit ".
"into outfile '$pstateDir/vinterfaces' ")
or $errors++;
# This ordering is for wrapper/mapper regression testing.
DBQueryWarn("select * from interface_settings where $clause ".
"order by node_id,iface,capkey ".
"into outfile '$pstateDir/interface_settings' ")
or $errors++;
# interfaces table is special, and this is probably wrong to do anyway
# since we overwrite columns that are fixed.
DBQueryWarn("select * from interfaces where ($clause) and ".
......@@ -3140,6 +3149,7 @@ sub BackupPhysicalState($;$$)
# Reserved table is special; we do not want to bring it back in during
# the restore. We just want the info from it.
foreach my $table (keys(%physicalTables), "reserved") {
# This ordering is for wrapper/mapper regression testing.
my $orderby = "";
if (exists($physicalTables{$table}) &&
defined($physicalTables{$table})) {
......
......@@ -42,6 +42,12 @@ sub debugging() {return $debug; }
# Set during initial crossover.
my $initialize = 0;
my %LanTables = ("lans" => ["lanid"],
"lan_attributes" => ["lanid", "attrkey"],
"lan_members" => ["lanid", "memberid"],
"lan_member_attributes" => ["lanid", "memberid", "attrkey"],
"ifaces" => ["lanid", "ifaceid"]);
#
# Lookup and create a class instance to return.
#
......@@ -292,9 +298,15 @@ sub BackupExperimentLans($$$)
}
foreach my $table ("lans", "lan_attributes", "lan_members",
"lan_member_attributes", "ifaces") {
# This ordering is for wrapper/mapper regression testing.
my $orderby = "";
if (exists($LanTables{$table}) &&
defined($LanTables{$table})) {
$orderby = "order by " . join(",", @{$LanTables{$table}});
}
DBQueryWarn("select * from $table where ".
join(" or ", map("lanid='$_'", @lanids)) . " " .
"into outfile '$pstatedir/$table'")
"$orderby into outfile '$pstatedir/$table'")
or return -1;
}
......@@ -1607,7 +1619,7 @@ sub Instantiate($)
}
# Members ...
foreach my $key (keys(%{ $self->{"MEMBERS"} })) {
foreach my $key (sort(keys(%{ $self->{"MEMBERS"} }))) {
my $member = $self->{"MEMBERS"}->{$key};
if (!$lan->AddMember($member->{'node'}, $member->{'iface'})) {
......@@ -1617,7 +1629,7 @@ sub Instantiate($)
}
# Interfaces ...
foreach my $key (keys(%{ $self->{"IFACES"} })) {
foreach my $key (sort(keys(%{ $self->{"IFACES"} }))) {
my $interface = $self->{"IFACES"}->{$key};
if (!$lan->AddInterface($interface->{'node'},
......
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