Clean-ups
[invirt/third/libt4.git] / rsm_tester.cc
1 //
2 // RSM test client
3 //
4
5 #include "types.h"
6 #include "rsm_protocol.h"
7 #include "rsmtest_client.h"
8
9 int main(int argc, char *argv[]) {
10     global = new t4_state('t');
11     if(argc != 4){
12         LOG_NONMEMBER << "Usage: " << argv[0] << " [host:]port [partition] arg";
13         return 1;
14     }
15
16     rsmtest_client *lc = new rsmtest_client(argv[1]);
17     string command(argv[2]);
18     if (command == "partition") {
19         LOG_NONMEMBER << "net_repair returned " << lc->net_repair(std::stoi(argv[3]));
20     } else if (command == "breakpoint") {
21         int b = std::stoi(argv[3]);
22         LOG_NONMEMBER << "breakpoint " << b << " returned " << lc->breakpoint(b);
23     } else {
24         LOG_NONMEMBER << "Unknown command " << argv[2];
25     }
26     return 0;
27 }