Retry delbr on linux_router deconfig

With small but non-zero probability test bomb out doing an "addif"
in tests where there's a "config" step followed by another "config"
step.  This is because in order to do the "config", we quickly do
a "deconfig" and another "config".  In that short period of time
after hostapd is started, it might take a while for hostapd to come
to a halt, holding the bridge device open.  If you look through the
logs, you'll find that the previous "delbr" of the bridge interface
did not succeed, but its error was ignored.

More troublingly, it seems that the automated tests seem to run into
this issue much more regularly than developers do with "run_remote_tests".

This change retries the "delbr" between sleeps if the first one
fails, and then exit with an error if the last attempt is not
successful.

BUG=none (chat from dalecurtis)
TEST=Reran SecMat 00*

Revert "Move deftxkey into first config block"

This reverts commit ad52b3d64a0ee579caa77123969288f3b9fe81d2.

Review URL: http://codereview.chromium.org/3334002
2 files changed