-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
79 lines (52 loc) · 2.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ARG PY_VER=2.7
FROM python:${PY_VER}
RUN apt-get update && apt-get install -y tcpdump xmlstarlet
RUN pip install pytest pytest-coverage
COPY . /src/
WORKDIR /src/
RUN pip install -e .
RUN py.test --cov=kismetdb --cov-report=term-missing
###
# Test v4
# Test KML script
RUN kismet_log_to_kml --in=./tests/assets/testdata.kismet_4 --out=./out.kml > /dev/null
RUN cat ./out.kml | wc -l
RUN xmlstarlet val ./out.kml
# Test CSV script
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_4 --table=devices --out=./devices.csv > /dev/null
RUN cat devices.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_4 --table=packets --out=packets.csv > /dev/null
RUN cat packets.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_4 --table=datasources --out=./datasources.csv > /dev/null
RUN cat datasources.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_4 --table=alerts --out=./alerts.csv > /dev/null
RUN cat alerts.csv | wc -l
# Test pcap script
RUN kismet_log_to_pcap --in=./tests/assets/testdata.kismet_4 --out=./out.pcap > /dev/null
RUN tcpdump -r ./out.pcap > /dev/null
RUN kismet_log_devices_to_json --in=./tests/assets/testdata.kismet_4 --out=./out.json
RUN cat ./out.json | wc -l
RUN kismet_log_devices_to_filebeat_json --in=./tests/assets/testdata.kismet_4 | wc -l
###
# Test v5
# Test KML script
RUN kismet_log_to_kml --in=./tests/assets/testdata.kismet_5 --out=./out.kml > /dev/null
RUN cat ./out.kml | wc -l
RUN xmlstarlet val ./out.kml
# Test CSV script
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_5 --table=devices --out=./devices.csv > /dev/null
RUN cat devices.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_5 --table=packets --out=packets.csv > /dev/null
RUN cat packets.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_5 --table=datasources --out=./datasources.csv > /dev/null
RUN cat datasources.csv | wc -l
RUN kismet_log_to_csv --in=./tests/assets/testdata.kismet_5 --table=alerts --out=./alerts.csv > /dev/null
RUN cat alerts.csv | wc -l
# Test pcap script
RUN kismet_log_to_pcap --in=./tests/assets/testdata.kismet_5 --out=./out.pcap > /dev/null
RUN tcpdump -r ./out.pcap > /dev/null
RUN kismet_log_devices_to_json --in=./tests/assets/testdata.kismet_5 --out=./out.json
RUN cat ./out.json | wc -l
RUN kismet_log_devices_to_filebeat_json --in=./tests/assets/testdata.kismet_5 | wc -l
###### Flush it!
FROM ubuntu:18.04