Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cecylia Bocovich
probetest
Commits
47a08526
Commit
47a08526
authored
Dec 06, 2019
by
Cecylia Bocovich
Browse files
Fixing up snowflake stage analysis
parent
9ba2c50a
Changes
2
Hide whitespace changes
Inline
Side-by-side
snowflake-throughput.py
View file @
47a08526
...
...
@@ -104,7 +104,7 @@ if __name__ == "__main__":
for
i
in
range
(
0
,
100
):
test_id
=
i
pcap_file
=
(
"%s/snowflake-probe-%d.pcap"
%
(
LOG_PATH
,
i
)
)
pcap_file
=
(
"%s/snowflake-probe-%d
-lo
.pcap"
%
(
LOG_PATH
,
i
)
)
log_file
=
(
"%s/snowflake-probe-%d.log"
%
(
LOG_PATH
,
i
)
)
sys
.
stderr
.
write
(
"Processing snowflake probe %d
\n
"
%
i
)
...
...
snowflaketest
View file @
47a08526
...
...
@@ -21,13 +21,12 @@ CIRCUIT_BUILD_TIMEOUT = 3*60
SNOWFLAKE_PATH
=
"/usr/bin/snowflake"
def
start_tcpdump
(
basename
,
interface
):
bpf
=
"tcp"
# http://packetlife.net/blog/2010/mar/19/sniffing-wireshark-non-root-user/
# groupadd tcpdump
# usermod -a -G tcpdump user
# chgrp tcpdump /usr/sbin/tcpdump
# setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
p
=
subprocess
.
Popen
([
"/usr/sbin/tcpdump"
,
"-i"
,
interface
,
"-U"
,
"-B"
,
"4096"
,
"-w"
,
basename
+
".pcap"
,
bpf
],
p
=
subprocess
.
Popen
([
"/usr/sbin/tcpdump"
,
"-i"
,
interface
,
"-U"
,
"-B"
,
"4096"
,
"-w"
,
basename
+
"
-%s
.pcap"
%
interface
],
stdout
=
open
(
basename
+
".pcap"
,
"w"
),
stderr
=
open
(
basename
+
".tcpdump.err"
,
"w"
))
return
p
...
...
@@ -149,7 +148,7 @@ for x in range(0, 100):
#give data to log file
timestamp
=
datetime
.
utcnow
().
strftime
(
"%b %d %H:%M:%S.%f"
)
output
.
write
(
timestamp
+
"
\n
"
)
subprocess
.
Popen
([
"/usr/bin/tshark"
,
"-q"
,
"-Xlua_script:../../../../snowflake-stage.lua"
,
"-r"
,
"%s.pcap"
%
nickname
],
subprocess
.
Popen
([
"/usr/bin/tshark"
,
"-q"
,
"-Xlua_script:../../../../snowflake-stage.lua"
,
"-r"
,
"%s
-%s
.pcap"
%
(
nickname
,
"eth0"
)
],
stdout
=
output
).
communicate
()[
0
]
logging
.
info
(
"Probed snowflake proxy %d time(s)"
%
(
x
+
1
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment