add start and stop VM functions
This commit is contained in:
parent
9de26b6df0
commit
cc3dbeeb6c
@ -43,7 +43,7 @@ int main(int argc, char *argv[])
|
||||
print_version_string(Test);
|
||||
|
||||
Test->tprintf("Suspend Maxscale 000 machine and waiting\n");
|
||||
system(Test->maxscales->stop_vm_command[0]);
|
||||
Test->add_result(Test->maxscales->start_vm(0), "Failed to stop VM maxscale_000\n");
|
||||
sleep(FAILOVER_WAIT_TIME);
|
||||
|
||||
version = print_version_string(Test);
|
||||
@ -54,12 +54,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
Test->tprintf("Resume Maxscale 000 machine and waiting\n");
|
||||
system(Test->maxscales->start_vm_command[0]);
|
||||
Test->add_result(Test->maxscales->start_vm(0), "Failed to start VM maxscale_000\n");
|
||||
sleep(FAILOVER_WAIT_TIME);
|
||||
print_version_string(Test);
|
||||
|
||||
Test->tprintf("Suspend Maxscale 001 machine and waiting\n");
|
||||
system(Test->maxscales->stop_vm_command[1]);
|
||||
Test->add_result(Test->maxscales->start_vm(1), "Failed to stop VM maxscale_001\n");
|
||||
sleep(FAILOVER_WAIT_TIME);
|
||||
|
||||
version = print_version_string(Test);
|
||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
print_version_string(Test);
|
||||
Test->tprintf("Resume Maxscale 001 machine and waiting\n");
|
||||
system(Test->maxscales->start_vm_command[1]);
|
||||
Test->add_result(Test->maxscales->start_vm(1), "Failed to start VM maxscale_001\n");
|
||||
sleep(FAILOVER_WAIT_TIME);
|
||||
print_version_string(Test);
|
||||
|
||||
|
@ -472,3 +472,13 @@ const char* Nodes::ip(int i) const
|
||||
{
|
||||
return use_ipv6 ? IP6[i] : IP[i];
|
||||
}
|
||||
|
||||
int Nodes::start_vm(int node)
|
||||
{
|
||||
return(system(start_vm_command[node]));
|
||||
}
|
||||
|
||||
int Nodes::stop_vm(int node)
|
||||
{
|
||||
return(system(stop_vm_command[node]));
|
||||
}
|
||||
|
@ -158,6 +158,20 @@ public:
|
||||
*/
|
||||
int read_basic_env();
|
||||
|
||||
/**
|
||||
* @brief start_vm Start virtual machine
|
||||
* @param node Node number
|
||||
* @return 0 in case of success
|
||||
*/
|
||||
int start_vm(int node);
|
||||
|
||||
/**
|
||||
* @brief stop_vm Stop virtual machine
|
||||
* @param node Node number
|
||||
* @return 0 in case of success
|
||||
*/
|
||||
int stop_vm(int node);
|
||||
|
||||
private:
|
||||
int check_node_ssh(int node);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user