1#include "perf_index.h" 2#include "fail.h" 3#include <stdio.h> 4#include <stdlib.h> 5 6DECL_SETUP { 7 VERIFY(test_argc > 0, "missing argument"); 8 9 return PERFINDEX_SUCCESS; 10} 11 12DECL_TEST { 13 char* cmd; 14 int retval; 15 16 retval = asprintf(&cmd, "iperf -c \"%s\" -n %lld > /dev/null", test_argv[0], length); 17 VERIFY(retval > 0, "asprintf failed"); 18 19 retval = system(cmd); 20 VERIFY(retval == 0, "iperf command failed"); 21 22 return PERFINDEX_SUCCESS; 23} 24