autotest: Only expect BSS's on current SSID from background scans

johannes.berg@intel.com notes that background scans are used in the
context of roaming in wpa_supplicant, and results from background scans
are restricted to BSSes on the SSID we're currently associated with.
Fix our tests to reflect this by putting the BSS we're checking for
on the same SSID as the BSS we're associated with.

While here, refactor the code for retrieving hostapd MAC addresses so
that it uses shared ip addr parsing code.

BUG=chromium:332250
TEST=This is a test that continues to pass on ath9k parts, and now seems
to pass against mwifiex parts.

Change-Id: I7069a5caf29248cca766eed0bdcb186c2e95b26d
Reviewed-on: https://chromium-review.googlesource.com/181813
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
3 files changed