Skip to content

Commit

Permalink
fix test_ovs_unicast_local random failures
Browse files Browse the repository at this point in the history
Check whether local-mac add/del operation success by
looking at list-macs using vtep-ctl instead of return
value of add/del op.

del operation may fail in case if ovsdb-client might
have forced deleted mac to do logical switch cleanup

Closes-Bug: #1462215
Change-Id: I02640085352ebe7634a20e16c9100fac78419b35
(cherry picked from commit 3c9bf5e)
  • Loading branch information
Prabhjot Singh Sethi committed Jun 5, 2015
1 parent e5fe2a7 commit b95a691
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bool execute_vtep_cmd(const string &cmd) {
vtep_cmd += " --db=tcp:127.0.0.1:" +
integerToString(ovsdb_port) + " " + cmd ;
int ret = system(vtep_cmd.c_str());
//cout << ret << endl;
return (ret == 0);
}

Expand All @@ -37,12 +36,16 @@ bool del_physical_port(const string &physical_switch,

bool add_ucast_mac_local(const string &logical_switch, const string &mac,
const string &dest_ip) {
return execute_vtep_cmd("add-ucast-local Contrail-" + logical_switch +
" " + mac + " " + dest_ip);
execute_vtep_cmd("add-ucast-local Contrail-" + logical_switch +
" " + mac + " " + dest_ip);
return execute_vtep_cmd("list-local-macs Contrail-" + logical_switch +
" | grep " + mac);
}

bool del_ucast_mac_local(const string &logical_switch, const string &mac) {
return execute_vtep_cmd("del-ucast-local Contrail-" + logical_switch +
" " + mac);
execute_vtep_cmd("del-ucast-local Contrail-" + logical_switch +
" " + mac);
return !execute_vtep_cmd("list-local-macs Contrail-" + logical_switch +
" | grep " + mac);
}

0 comments on commit b95a691

Please sign in to comment.