]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/iperf.c
a8d0f3a2105408a2c2523583f3edd04d0f7385d7
[apple/xnu.git] / tools / tests / perf_index / iperf.c
1 #include <fcntl.h>
2 #include "perf_index.h"
3 #include <errno.h>
4
5 const stress_test_t iperf_test = {"iperf", &stress_general_init, &iperf, &stress_general_cleanup, &validate_iperf};
6
7 DECL_VALIDATE(validate_iperf) {
8 return (test_argc >= 1);
9 }
10
11 DECL_TEST(iperf) {
12 char *cmd;
13 assert(asprintf(&cmd, "iperf -c \"%s\" -n %lld > /dev/null", test_argv[0], length) >= 0);
14 assert(system(cmd) == 0);
15 free(cmd);
16 }