Skip to content

Commit

Permalink
Updated testsuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Apr 17, 2013
1 parent 627e626 commit 56a2a3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion testsuite/tests/bond.out
Expand Up @@ -11,12 +11,15 @@ Read .etc.install_inf.BrokenModules nil
Read .udev_persistent.net nil
Dir .modules.options: []
Read .udev_persistent.drivers nil
Dir .network.section: ["bond0", "eth1", "eth2", "eth4", "eth5", "eth6"]
Dir .network.section: ["bond0", "bond1", "eth1", "eth2", "eth4", "eth5", "eth6"]
Dir .network.value."bond0": ["BONDING_MASTER", "BONDING_SLAVE0", "BONDING_SLAVE1", "BOOTPROTO"]
Read .network.value."bond0".BONDING_MASTER "yes"
Read .network.value."bond0".BONDING_SLAVE0 "eth1"
Read .network.value."bond0".BONDING_SLAVE1 "eth2"
Read .network.value."bond0".BOOTPROTO "static"
Dir .network.value."bond1": ["BONDING_MASTER", "BOOTPROTO"]
Read .network.value."bond1".BONDING_MASTER "yes"
Read .network.value."bond1".BOOTPROTO "static"
Dir .network.value."eth1": ["BOOTPROTO"]
Read .network.value."eth1".BOOTPROTO "none"
Dir .network.value."eth2": ["BOOTPROTO"]
Expand Down
12 changes: 11 additions & 1 deletion testsuite/tests/bond.ycp
Expand Up @@ -36,6 +36,7 @@ map READ = $[
"eth6" : nil,

"bond0" : nil,
"bond1" : nil,
],
"value" : $[
"eth1" : $["BOOTPROTO":"none"],
Expand All @@ -52,6 +53,10 @@ map READ = $[
"BONDING_SLAVE0":"eth1",
"BONDING_SLAVE1":"eth2",
],
"bond1" : $[
"BOOTPROTO":"static",
"BONDING_MASTER":"yes",
],
]
],
"probe" : $[
Expand Down Expand Up @@ -97,11 +102,16 @@ Testsuite::Dump("LanItems::GetBondSlaves");
list expected_bond_slaves = [ "eth1", "eth2" ];
Assert::Equal( expected_bond_slaves, LanItems::GetBondSlaves( "bond0"));

expected_bond_slaves = [];
Assert::Equal( expected_bond_slaves, LanItems::GetBondSlaves( "bond1"));

Testsuite::Dump("LanItems::GetBondableInterfaces");
list< string> expected_bondable = [ "eth1", "eth11", "eth12", "eth2", "eth4", "eth5"];
list< string> expected_bondable = [ "eth11", "eth12", "eth4", "eth5"];
list< string> bondable_devs = [];

// query bondable devices and make testsuite independent of internal sorting of LanItems
Assert::Equal( true, LanItems::FindAndSelect( "bond1") ); // set up context for GetBondableInterfaces

bondable_devs = maplist(integer itemId, LanItems::GetBondableInterfaces(), ``( LanItems::GetDeviceName( itemId) ));
bondable_devs = sort( bondable_devs);

Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/bridge.ycp
Expand Up @@ -91,7 +91,7 @@ import "LanItems";
Testsuite::Test( LanItems::Read(), [READ, $[], EXEC], nil);

Testsuite::Dump("LanItems::GetBridgeableInterfaces");
list< string> expected_bridgeable = [ "bond0", "eth1", "eth11", "eth12", "eth2", "eth4", "tap0", "tun0"];
list< string> expected_bridgeable = [ "bond0", "eth11", "eth12", "eth4", "tap0", "tun0"];
list< string> bridgeable_devs = [];

// query bridgeable devices and make testsuite independent of internal sorting of LanItems
Expand Down

0 comments on commit 56a2a3d

Please sign in to comment.