示例#1
0
 def test_startstop_client_custom_vars(self):
     """test command line start/stop client (custom vars)"""
     self.fs.new_target(self.srv1, 'mgt', 0, '/dev/root')
     # fs_name
     mtpt = '/action'
     client = self.fs.new_client(self.srv1, "/$fs_name")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "%s" && ' \
            '/bin/mount -t lustre localhost@tcp:/action %s' % (mtpt, mtpt))
     action = StopClient(client)
     self.check_cmd(action, 'umount %s' % mtpt)
     # label
     mtpt = '/action-client'
     client = self.fs.new_client(self.srv1, "/$label")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "%s" && ' \
            '/bin/mount -t lustre localhost@tcp:/action %s' % (mtpt, mtpt))
     action = StopClient(client)
     self.check_cmd(action, 'umount %s' % mtpt)
     # type
     mtpt = '/client'
     client = self.fs.new_client(self.srv1, "/client")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "%s" && ' \
            '/bin/mount -t lustre localhost@tcp:/action %s' % (mtpt, mtpt))
     action = StopClient(client)
     self.check_cmd(action, 'umount %s' % mtpt)
示例#2
0
 def test_start_client_simple(self):
     """test command line start client (mgs one nid)"""
     self.fs.new_target(self.srv1, 'mgt', 0, '/dev/root')
     client = self.fs.new_client(self.srv1, "/foo")
     action = StartClient(client)
     self.assertEquals(sorted(action.needed_modules()), ['lustre'])
     self.check_cmd(action, 'mkdir -p "/foo" && ' +
                          '/bin/mount -t lustre localhost@tcp:/action /foo')
示例#3
0
 def test_start_client_addl_options(self):
     """test command line start client (addl options)"""
     self.fs.new_target(self.srv1, 'mgt', 0, '/dev/root')
     client = self.fs.new_client(self.srv1, "/foo")
     action = StartClient(client, addopts='user_xattr')
     self.check_cmd(action, 'mkdir -p "/foo" && ' +
            '/bin/mount -t lustre -o user_xattr localhost@tcp:/action /foo')
示例#4
0
 def test_start_client_mount_options(self):
     """test command line start client (mount options)"""
     self.fs.new_target(self.srv1, 'mgt', 0, '/dev/root')
     client = self.fs.new_client(self.srv1, "/foo", mount_options="acl")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "/foo" && ' +
                   '/bin/mount -t lustre -o acl localhost@tcp:/action /foo')
示例#5
0
 def test_start_client_mgs_failover(self):
     """test command line start client (mgs failover)"""
     mgt = self.fs.new_target(self.srv1, 'mgt', 0, '/dev/root')
     mgt.add_server(self.srv2)
     client = self.fs.new_client(self.srv1, "/foo")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "/foo" && ' +
           '/bin/mount -t lustre localhost@tcp:localhost2@tcp:/action /foo')
示例#6
0
 def test_start_client_two_nids(self):
     """test command line start client (mgs two nids)"""
     srv = Server('localhost', ['localhost@tcp','localhost@o2ib'])
     self.fs.new_target(srv, 'mgt', 0, '/dev/root')
     client = self.fs.new_client(self.srv1, "/foo")
     action = StartClient(client)
     self.check_cmd(action, 'mkdir -p "/foo" && ' +
           '/bin/mount -t lustre localhost@tcp,localhost@o2ib:/action /foo')
示例#7
0
 def test_start_client_subdir(self):
     """test command line start client (subdir)"""
     self.fs.new_target(self.srv1, 'mgt', 0, self.block1)
     client = self.fs.new_client(self.srv1, "/foo", subdir="projects")
     action = StartClient(client)
     self.check_cmd(
         action, 'mkdir -p "/foo" && ' +
         '/bin/mount -t lustre localhost@tcp:/action/projects /foo')
示例#8
0
 def test_start_client_both_options(self):
     """test command line start client (both options)"""
     self.fs.new_target(self.srv1, 'mgt', 0, self.block1)
     client = self.fs.new_client(self.srv1, "/foo", mount_options="acl")
     action = StartClient(client, addopts='user_xattr')
     self.check_cmd(
         action, 'mkdir -p "/foo" && ' +
         '/bin/mount -t lustre -o acl,user_xattr localhost@tcp:/action /foo'
     )
示例#9
0
 def mount(self, **kwargs):
     """Mount a Lustre client."""
     return StartClient(self, **kwargs)