3.9 KiB
Task 1 Report: Cached OUI Identity Resolution
Status
Implemented and verified cached local OUI identity resolution while preserving the existing oui_vendor() behavior and unrelated unstaged HTML report changes.
Checklist
- Added failing resolver tests before production changes.
- Verified the tests failed because
OUI_DATA_PATHSandoui_identity()were absent. - Added Nmap and macchanger data paths.
- Added a lazy process-level identity cache.
- Added local database parsing for plain and separated OUI prefixes.
- Preserved Nmap precedence over macchanger and built-in fallback.
- Added local/randomized and unknown identities.
- Returned JSON-safe dictionaries with
manufacturer,model,oui, andsource. - Kept
modelasNonefor every source. - Preserved
oui_vendor()behavior. - Ran focused and regression tests.
- Self-reviewed the diff and checked whitespace.
TDD Evidence
Initial command:
python3 -m unittest tests.test_recon.OuiVendorTest -v
Initial result before implementation:
Ran 8 tests in 0.005s
FAILED (errors=3)
All three new identity tests errored at mock.patch.object(server, 'OUI_DATA_PATHS', ...) with:
AttributeError: <module 'server' ...> does not have the attribute 'OUI_DATA_PATHS'
After the minimal implementation, the focused resolver test result was:
python3 -m unittest tests.test_recon.OuiVendorTest -v
Ran 9 tests in 0.005s
OK
Final Verification
Command:
python3 -m unittest tests.test_recon.DecodersTest -v
Output:
test_decode_encryption_cases (tests.test_recon.DecodersTest.test_decode_encryption_cases) ... ok
test_decode_ssid_bytes_and_str (tests.test_recon.DecodersTest.test_decode_ssid_bytes_and_str) ... ok
test_decode_ssid_cli_escapes (tests.test_recon.DecodersTest.test_decode_ssid_cli_escapes) ... ok
test_fmt_mac_colon_form (tests.test_recon.DecodersTest.test_fmt_mac_colon_form) ... ok
test_fmt_mac_noop (tests.test_recon.DecodersTest.test_fmt_mac_noop) ... ok
test_norm_mac_12hex (tests.test_recon.DecodersTest.test_norm_mac_12hex) ... ok
----------------------------------------------------------------------
Ran 6 tests in 0.005s
OK
Command:
python3 -m unittest tests.test_recon -v
Output summary:
----------------------------------------------------------------------
Ran 119 tests in 0.681s
OK
All 119 individual tests printed ... ok; there were no failures, errors, or warnings.
Command:
git diff --check
Output: no output; exit status 0.
Self-Review
- Local/randomized detection occurs before cache loading, avoiding unnecessary file access.
- Cache precedence follows path order and never overwrites an earlier prefix.
- Missing files are skipped without masking parsing or programming errors.
- Unknown and invalid MACs return JSON-safe values.
AAwas not used as the unknown global test prefix because its locally administered bit is set;ACcorrectly represents a globally administered unknown prefix.- Existing unstaged HTML signal-ordering changes in
server.pyandtests/test_recon.pyare intentionally excluded from the Task 1 commit.
Concerns
None. Database source labels rely on the specified two-entry OUI_DATA_PATHS ordering.
Live Path Correction
The committed Task 1 diff used /usr/share/macchanger/OUI.list, but the design
specification and live macchanger package use
/usr/share/macchanger/wireless.list. Updated OUI_DATA_PATHS to the required
live path. Resolver tests patch OUI_DATA_PATHS, so no test changes were needed.
Verification after the correction:
python3 -m unittest tests.test_recon.OuiVendorTest -v
Ran 9 tests in 0.005s
OK
python3 -m unittest tests.test_recon -v
Ran 119 tests in 0.498s
OK
The unrelated unstaged HTML signal-ordering changes in server.py and
tests/test_recon.py, plus untracked loot and certificate files, remain
excluded from this correction.