diff --git a/maxscale-system-test/fwf_syntax.cpp b/maxscale-system-test/fwf_syntax.cpp index 04df1a428..b50c42d9f 100644 --- a/maxscale-system-test/fwf_syntax.cpp +++ b/maxscale-system-test/fwf_syntax.cpp @@ -41,9 +41,9 @@ const char *rules_failure[] = NULL }; -void truncate_maxscale_logs(TestConnections& test) +int truncate_maxscale_logs(TestConnections& test) { - test.maxscales->ssh_node(0, "truncate -s 0 /var/log/maxscale/*", true); + return test.maxscales->ssh_node(0, "truncate -s 0 /var/log/maxscale/max*", true); } void create_rule(const char *rule, const char* user) @@ -63,7 +63,7 @@ int main(int argc, char** argv) for (int i = 0; rules_failure[i]; i++) { /** Create rule file with syntax error */ - truncate(temp_rules, 0); + test.add_result(truncate(temp_rules, 0), "Failed to truncate"); create_rule(rules_failure[i], users_ok[0]); copy_rules(&test, (char*)temp_rules, (char*)test_dir); @@ -74,7 +74,7 @@ int main(int argc, char** argv) * a message about the syntax error. */ test.check_maxscale_processes(0, 0); test.check_log_err(0, "syntax error", true); - truncate_maxscale_logs(test); + test.add_result(truncate_maxscale_logs(test), "Failed to truncate Maxscale logs"); } return test.global_result; diff --git a/maxscale-system-test/rds_vpc.cpp b/maxscale-system-test/rds_vpc.cpp index a7c6a188e..1a8923595 100644 --- a/maxscale-system-test/rds_vpc.cpp +++ b/maxscale-system-test/rds_vpc.cpp @@ -168,6 +168,7 @@ int RDS::destroy_route_tables() json_t *root; char cmd[1024]; char * json; + int res = 0; sprintf(cmd, "aws ec2 describe-vpcs --vpc-ids=%s", vpc_id_intern); if (execute_cmd(cmd, &json)) @@ -196,11 +197,11 @@ int RDS::destroy_route_tables() if (strcmp(vpc_id_intern, vpc_id) == 0) { sprintf(cmd, "aws ec2 delete-route-table --route-table-id %s", rt_id); - system(cmd); + res += system(cmd); } } - return 0; + return res; } int RDS::detach_and_destroy_gw() diff --git a/maxscale-system-test/script.cpp b/maxscale-system-test/script.cpp index 50e3e07f4..2d1a1e7d5 100644 --- a/maxscale-system-test/script.cpp +++ b/maxscale-system-test/script.cpp @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) "scp -i %s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet script_output_expected* %s@%s:%s/", Test->maxscales->sshkey[0], Test->maxscales->access_user[0], Test->maxscales->IP[0], Test->maxscales->access_homedir[0]); - system(str); + Test->add_result(system(str), "Error copying script to VM"); sprintf(str, "%s/script_output_expected", Test->maxscales->access_homedir[0]); test_script_monitor(Test, Test->repl, str); diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index e837d108e..7a6864540 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -1964,14 +1964,14 @@ void TestConnections::check_current_connections(int m, int value) int TestConnections::take_snapshot(char * snapshot_name) { - char str[4096]; + char str[strlen(take_snapshot_command) + strlen(snapshot_name) + 2]; sprintf(str, "%s %s", take_snapshot_command, snapshot_name); return system(str); } int TestConnections::revert_snapshot(char * snapshot_name) { - char str[4096]; + char str[strlen(revert_snapshot_command) + strlen(snapshot_name) + 2]; sprintf(str, "%s %s", revert_snapshot_command, snapshot_name); return system(str); }