~chris.macnaughton/openstack-mojo-specs/nova-compute-migration

« back to all changes in this revision

Viewing changes to helper/tests/test_gluster.py

  • Committer: Ryan Beisner
  • Date: 2016-12-07 18:46:37 UTC
  • mfrom: (262.2.3 mojo-openstack-specs)
  • Revision ID: ryan.beisner@canonical.com-20161207184637-qe7hhtbbpestjvyd
[xfactor973,r=1chb1n] Add gluster mojo spec test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import sys
 
4
 
 
5
import utils.mojo_utils as mojo_utils
 
6
 
 
7
 
 
8
def main(argv):
 
9
    # Mount the storage volume
 
10
    mojo_utils.remote_run(
 
11
        'gluster/0',
 
12
        'mkdir /mnt/gluster && mount -t glusterfs localhost:test /mnt/gluster')
 
13
    mojo_utils.remote_run(
 
14
        'gluster/1',
 
15
        'mkdir /mnt/gluster && mount -t glusterfs localhost:test /mnt/gluster')
 
16
    mojo_utils.remote_run(
 
17
        'gluster/2',
 
18
        'mkdir /mnt/gluster && mount -t glusterfs localhost:test /mnt/gluster')
 
19
 
 
20
    # Check
 
21
    mojo_utils.remote_run('gluster/0',
 
22
                          'echo 123456789 > /mnt/gluster/test_input')
 
23
 
 
24
    # Check
 
25
    output = mojo_utils.remote_run('gluster/1', 'cat /mnt/gluster/test_input')
 
26
 
 
27
    # Cleanup
 
28
    mojo_utils.remote_run('gluster/2', 'rm /mnt/gluster/test_input')
 
29
    if output[0].strip() != "123456789":
 
30
        sys.exit(1)
 
31
 
 
32
 
 
33
if __name__ == "__main__":
 
34
    sys.exit(main(sys.argv))