1 module glustercli;
2 
3 public import glustercli.volume;
4 public import glustercli.volume_parser: Volume;
5 public import glustercli.peer;
6 public import glustercli.peer_parser: Peer;
7 
8 void voltypeTest(ref Volume volinfo, string expectedType)
9 {
10     assert(volinfo.type == expectedType);
11 }
12 
13 unittest
14 {
15     import std.process: environment;
16     import std.format: format;
17 
18     string hostname = environment.get("GLUSTER_HOST");
19     string brickRootdir = environment.get("BRICK_ROOT");
20     string volname = "gv1";
21     auto brick = format!"%s:%s/%s/brick%d/brick"(hostname, brickRootdir, volname, 1);
22     
23     VolumeCreateOptions opts = {force: true};
24     volumeCreate(volname, [brick], opts);
25     auto vollist = volumeList();
26     assert(vollist.length == 1);
27     assert(vollist[0] == volname);
28     auto volinfo = volumeInfo(volname);
29     voltypeTest(volinfo[0], "Distribute");
30     
31     // 1 brick distribute - gv1
32     // 1 brick distribute without force
33     // 3 brick distribute - gv2
34     // 3 brick replica - gv3
35     // 3 brick disperse - gv4
36     // 3 brick arbiter - gv5
37     // 3x2 brick dist-rep - gv6
38     // 3x2 brick dist-disp - gv7
39     // 3x2 brick dist-arbiter - gv8
40 
41     // For each Volume test the following
42     // Present in Vollist
43     // From Volinfo,
44     //     check volume name
45     //     check volume type
46     //     check number of bricks
47     //     brick position validate
48     //     subvol type
49     //     number of subvols
50     //     status == created
51     //     validate replicaCount and other counts
52 
53     // For each Volume
54     // Volume start
55     //     check status == started
56     //     brick ports check
57     //     brick status check
58     // Kill a brick and check brick status
59     // Volume start force and check brick status
60 
61     // Volume stop
62     //    check status == stopped
63 
64     // Volume delete
65     //     Check Not in volume list
66 
67 
68     // Cleanup
69     
70 }