wifi codelab: Add codelab to teach 802.11 basics
This codelab uses the existing autotest network_WiFi_SimpleConnect
to teach the basics of 802.11 connection protocols.
BUG=chromium:1010953
TEST=`${CROS_ROOT}/docs/scripts/preview_docs
./docs/wifi-basics-codelab.md` verify rendering. Use mdl to lint.
Completed the codelab successfully.
Change-Id: Ib13fdc782b6c537bcbaad749c8e44517bb1a8e35
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1836573
Tested-by: Kevin Lund <kglund@google.com>
Commit-Queue: Kevin Lund <kglund@google.com>
Reviewed-by: Kirtika Ruchandani <kirtika@chromium.org>
diff --git a/docs/wifi-basics-codelab-pcap-test.py b/docs/wifi-basics-codelab-pcap-test.py
new file mode 100644
index 0000000..b7331c9
--- /dev/null
+++ b/docs/wifi-basics-codelab-pcap-test.py
@@ -0,0 +1,30 @@
+from os import path
+
+golden_sequences = [['0x04', '0x05', '0x0b', '0x00', '0x01', '0x0c'],
+ ['0x04', '0x05', '0x0b', '0x01', '0x0c']]
+
+pcap_filepath = '/tmp/filtered_pcap'
+if not path.exists(pcap_filepath):
+ print('Could not find output file. Follow the steps in section 5 of ' +
+ 'the codelab to generate a pcap output file.')
+ exit()
+pcap_file = open(pcap_filepath, 'r')
+
+for line in pcap_file:
+ packet_type = line[0:4]
+ if not packet_type.startswith('0x0'):
+ print('Failure: Non-connection packet of type ' + packet_type +
+ ' included in output.')
+ exit()
+ for sequence in golden_sequences:
+ if sequence[0] == packet_type:
+ sequence.pop(0)
+ if len(sequence) == 0:
+ print('Success: The full connection sequence was included in ' +
+ 'your output!')
+ exit()
+pcap_file.close()
+
+print('Failure: Your output file did not include the full connection ' +
+ 'sequence. You may need to add more packet types to your filter.')
+exit()
\ No newline at end of file