Skip to content
Snippets Groups Projects
Commit f27e6dec authored by Michael Marsh's avatar Michael Marsh
Browse files

check inputs

parent d05227af
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,19 @@ parser.add_argument('-L', '--loss',
args = parser.parse_args()
if args.device is None:
print STDERR, 'You must specify a device with --device.'
exit 1
if args.namespace is None:
print STDERR, 'You must specify a network namespace with --namespace.'
exit 1
# Enable network emulation on the device.
cmd = ["sudo", "/sbin/ip",
"netns", "exec", args.namespace,
"tc", "qdisc", "change", "dev", args.device, "root",
"netem"]
if args.delay is not None:
cmd.append("delay")
cmd.append(str(args.delay))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment