Build on wheezy, and presumably precise
[invirt/third/libt4.git] / rsm_tester.cc
1 //
2 // RSM test client
3 //
4
5 #include "rsm_protocol.h"
6 #include "rsmtest_client.h"
7 #include "rpc.h"
8 #include <arpa/inet.h>
9 #include <vector>
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <string>
13 using namespace std;
14
15 rsmtest_client *lc;
16
17 int
18 main(int argc, char *argv[])
19 {
20   int r;
21
22   if(argc != 4){
23     fprintf(stderr, "Usage: %s [host:]port [partition] arg\n", argv[0]);
24     exit(1);
25   }
26
27   lc = new rsmtest_client(argv[1]);
28   string command(argv[2]);
29   if (command == "partition") {
30     r = lc->net_repair(atoi(argv[3]));
31     printf ("net_repair returned %d\n", r);
32   } else if (command == "breakpoint") {
33     int b = atoi(argv[3]);
34     r = lc->breakpoint(b);
35     printf ("breakpoint %d returned %d\n", b, r);
36   } else {
37     fprintf(stderr, "Unknown command %s\n", argv[2]);
38   }
39   exit(0);
40 }