Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #87 from m-lab/rebase
Browse files Browse the repository at this point in the history
Rebase to pickup some changes in ndt-project (upstream)
  • Loading branch information
gfr10598 committed Mar 24, 2017
2 parents 3fb1df4 + 6c1d248 commit aeaf958
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ services:
- docker

script:
- docker pull gcr.io/mlab-pub/github-m-lab-builder:latest

# Temporarily use the git repo dev branch, instead of the google container registry.
# TODO - update this once the GCR builder is up to date.
- docker build -t build https://github.com/m-lab/builder.git#dev
- docker run build /root/ndt_build_and_test.sh dev

#- docker pull gcr.io/mlab-pub/github-m-lab-builder:latest
# Run basic unit tests that don't require web100
- docker run gcr.io/mlab-pub/github-m-lab-builder /root/ndt_build_and_test.sh
#- docker run gcr.io/mlab-pub/github-m-lab-builder /root/ndt_build_and_test.sh

# TODO - collect coverage stats and export to coveralls.

# TODO - collect coverage stats and export to coveralls.
38 changes: 26 additions & 12 deletions src/web100clt.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,12 @@ void testResults(char tests, char *testresult_str, char* host) {
}

sysvar = strtok(testresult_str, " ");
sysval = strtok(NULL, "\n");
i = atoi(sysval);
save_int_values(sysvar, i);

for (;;) {
sysvar = strtok(NULL, " ");
if (sysvar == NULL)
break;
sysval = strtok(NULL, "\n");
if (sysval == NULL)
break;
if (strchr(sysval, '.') == NULL) {
i = atoi(sysval);
save_int_values(sysvar, i);
Expand All @@ -167,6 +164,7 @@ void testResults(char tests, char *testresult_str, char* host) {
save_dbl_values(sysvar, &j);
log_println(7, "Stored %0.2f (%s) in %s", j, sysval, sysvar);
}
sysvar = strtok(NULL, " ");
}

// CountRTT = 615596;
Expand Down Expand Up @@ -924,6 +922,12 @@ int main(int argc, char *argv[]) {
} else
ptr = strtok_r(buff, " ", &strtokbuf);

/*
* Server may support less test types that we support. Hence, collect
* into this var _only_ the test types that were run successfully.
*/
unsigned char run_tests = 0;

// Run all tests requested, based on the ID.
while (ptr) {
if (check_int(ptr, &testId)) {
Expand All @@ -935,39 +939,45 @@ int main(int argc, char *argv[]) {
if (test_mid_clt(ctlSocket, tests, host, conn_options, buf_size,
mid_resultstr, jsonSupport)) {
log_println(0, "Middlebox test FAILED!");
tests &= (~TEST_MID);
} else {
run_tests |= TEST_MID;
}
break;
case TEST_C2S:
if (test_c2s_clt(ctlSocket, tests, host, conn_options, buf_size, &c2s_ThroughputSnapshots, jsonSupport, 0)) {
log_println(0, "C2S throughput test FAILED!");
tests &= (~TEST_C2S);
} else {
run_tests |= TEST_C2S;
}
break;
case TEST_C2S_EXT:
if (test_c2s_clt(ctlSocket, tests, host, conn_options, buf_size, &c2s_ThroughputSnapshots, jsonSupport, 1)) {
log_println(0, "Extended S2C throughput test FAILED!");
tests &= (~TEST_C2S_EXT);
} else {
run_tests |= TEST_C2S_EXT;
}
break;
case TEST_S2C:
if (test_s2c_clt(ctlSocket, tests, host, conn_options, buf_size,
resultstr, &s2c_ThroughputSnapshots, jsonSupport, 0)) {
log_println(0, "S2C throughput test FAILED!");
tests &= (~TEST_S2C);
} else {
run_tests |= TEST_S2C;
}
break;
case TEST_S2C_EXT:
if (test_s2c_clt(ctlSocket, tests, host, conn_options, buf_size,
resultstr, &s2c_ThroughputSnapshots, jsonSupport, 1)) {
log_println(0, "Extended S2C throughput test FAILED!");
tests &= (~TEST_S2C_EXT);
} else {
run_tests |= TEST_S2C_EXT;
}
break;
case TEST_SFW:
if (test_sfw_clt(ctlSocket, tests, host, conn_options, jsonSupport)) {
log_println(0, "Simple firewall test FAILED!");
tests &= (~TEST_SFW);
} else {
run_tests |= TEST_SFW;
}
break;
case TEST_META:
Expand All @@ -977,7 +987,8 @@ int main(int argc, char *argv[]) {

if (test_meta_clt(ctlSocket, tests, host, conn_options, client_app_id, jsonSupport)) {
log_println(0, "META test FAILED!");
tests &= (~TEST_META);
} else {
run_tests |= TEST_META;
}
break;
default:
Expand All @@ -987,6 +998,9 @@ int main(int argc, char *argv[]) {
ptr = strtok_r(NULL, " ", &strtokbuf);
}

/* Make sure we only process tests that were run */
tests = run_tests;

/* get the final results from server.
*
* The results are encapsulated by the MSG_RESULTS messages. The last
Expand Down

0 comments on commit aeaf958

Please sign in to comment.