Add variadic ssh function to mariadb_nodes

The ssh_node function now supports printf style arguments. This is used to
simplify command execution on the nodes.

Curreltny, in addition to its old usage, it is used to drop extra
databases when replication is started.
This commit is contained in:
Markus Mäkelä
2017-10-01 10:49:11 +03:00
parent 69557c650e
commit af08647fa2
10 changed files with 208 additions and 228 deletions

View File

@ -88,14 +88,11 @@ int main(int argc, char *argv[])
Test->repl->sync_slaves();
Test->set_timeout(200);
sprintf(str, "%s rm -f /tmp/t*.csv; %s chmod 777 /tmp", Test->repl->access_sudo[0],
Test->repl->access_sudo[0]);
Test->tprintf("%s\n", str);
for (int k = 0; k < Test->repl->N; k++)
{
Test->repl->ssh_node(k, str, false);
Test->repl->ssh_node(k, false, "%s rm -f /tmp/t*.csv; %s chmod 777 /tmp",
Test->repl->access_sudo[0], Test->repl->access_sudo[0]);
}
//system(str);
Test->tprintf("Copying data from t1 to file...\n");
Test->tprintf("using RWSplit: SELECT * INTO OUTFILE '/tmp/t1.csv' FROM t1;\n");