Skip to content

Commit

Permalink
Long overdue - starting to think about some basic black box tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gcla committed Jun 27, 2020
1 parent 0222532 commit e0a9f3f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ notifications:
before_install:
- openssl aes-256-cbc -K $encrypted_1286cb654632_key -iv $encrypted_1286cb654632_iv
-in configs/termshark-dd01307f2423.json.enc -out /tmp/google.json -d
- sudo apt-get install -y tshark
- sudo apt-get install -y tshark socat
addons:
apt:
update: true
script:
- go test -v ./...
- bash scripts/simple-tests.sh
deploy:
- provider: script
skip_cleanup: true
Expand Down
47 changes: 47 additions & 0 deletions scripts/simple-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

set -e

echo Started some simple termshark tests.

echo Installing termshark for test use.

go install ./...

echo Making a test pcap.

cat <<EOF | xxd -r -p > /tmp/test.pcap
d4c3b2a102000400
0000000000000000
0000040006000000
f32a395200000000
4d0000004d000000
1040002035012b59
0006291793f8aaaa
0300000008004500
0037f93900004011
a6dbc0a82c7bc0a8
2cd5f93900450023
8d730001433a5c49
424d54435049505c
6c63636d2e31006f
6374657400f32a39
52000000004d0000
004d000000104000
2035012b59000629
1793f8aaaa030000
00080045000037f9
3900004011a6dbc0
a82c7bc0a82cd5f9
39004500238d7300
01433a5c49424d54
435049505c6c6363
6d2e31006f637465
7400
EOF

echo Running termshark.

~/go/bin/termshark -r /tmp/test.pcap | grep 192.168.44.123

echo Tests were successful.

0 comments on commit e0a9f3f

Please sign in to comment.