5 use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
7 use afstest qw(obj_path);
8 use Test::More tests=>4;
9 use POSIX qw(:sys_wait_h :signal_h);
12 my $rxperf = obj_path("src/tools/rxperf/rxperf");
14 # Start up an rxperf server
18 fail("Failed to fork rxperf server");
22 "rxperf", "server", "-p", $port, "-u", "1024", "-H", "-N");
25 pass("Started rxperf server");
27 # Start up an rxperf client, and run a test
29 system("$rxperf client -c rpc -p $port -S 1048576 -R 1048576 -T 30 -u 1024 -H -N"),
30 "single threaded client ran successfully");
33 system("$rxperf client -c rpc -p $port -S 1048576 -R 1048576 -T 1 -t 30 -u 1024 -H -N"),
34 "multi threaded client ran succesfully");
36 # Kill the server, and check its exit code
40 my $ecode = ${^CHILD_ERROR_NATIVE};
41 if (WIFSIGNALED($ecode) && WTERMSIG($ecode) != SIGTERM) {
42 fail("Server died with signal ".WTERMSIG($ecode));
43 } elsif (WIFEXITED($ecode) && WEXITSTATUS($ecode) != 0) {
44 fail("Server exited with code". WEXITSTATUS($ecode));
46 pass("Server exited succesfully");