So many changes. Broken.
[invirt/third/libt4.git] / rsm_tester.cc
1 //
2 // RSM test client
3 //
4
5 #include "include/types.h"
6 #include "include/rsm_protocol.h"
7 #include "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         LOG_NONMEMBER << "breakpoint " << argv[3] << " returned " << lc->breakpoint(std::stoi(argv[3]));
22     else
23         LOG_NONMEMBER << "Unknown command " << argv[2];
24     return 0;
25 }