예제 #1
0
파일: test_nfs.py 프로젝트: ljb-2000/hummer
 def setUp(self):
     self.client = NFSRemoteClient('192.168.0.15', 22, 'wangtao', 'admin123')
예제 #2
0
 def setUp(self):
     self.client = NFSRemoteClient('192.168.0.15', 22, 'wangtao',
                                   'admin123')
예제 #3
0
파일: test_nfs.py 프로젝트: ljb-2000/hummer
class NFSClientTestCase(unittest.TestCase):

    def setUp(self):
        self.client = NFSRemoteClient('192.168.0.15', 22, 'wangtao', 'admin123')

    def tearDown(self):
        self.client.close()

    def test_makedir(self):
        self.client.makedir('/home/wangtao/testdir')

    def test_removedir(self):
        self.client.removedir('/home/wangtao/testdir')

    def test_copy_file_to_remote(self):
        res = self.client.copy_file_to_remote("/home/wangtao/images/nginx.tar",
            "/home/wangtao/nginx.tar")
        print(res)

    def test_copy_file_to_local(self):
        res = self.client.copy_file_to_local("/home/wangtao/nfs_install.sh",
            "/home/wangtao/nfs_install.sh")
        print(res)

    def test_tar_and_copy_to_local(self):
        self.client.tar_and_copy_to_local("/hummer/test",
            "/home/wangtao/test/test.tar")

    def test_copy_file_to_remote_and_untar(self):
        self.client.copy_file_to_remote_and_untar("/home/wangtao/test/test.tar",
            "/hummer/test")
예제 #4
0
class NFSClientTestCase(unittest.TestCase):
    def setUp(self):
        self.client = NFSRemoteClient('192.168.0.15', 22, 'wangtao',
                                      'admin123')

    def tearDown(self):
        self.client.close()

    def test_makedir(self):
        self.client.makedir('/home/wangtao/testdir')

    def test_removedir(self):
        self.client.removedir('/home/wangtao/testdir')

    def test_copy_file_to_remote(self):
        res = self.client.copy_file_to_remote("/home/wangtao/images/nginx.tar",
                                              "/home/wangtao/nginx.tar")
        print(res)

    def test_copy_file_to_local(self):
        res = self.client.copy_file_to_local("/home/wangtao/nfs_install.sh",
                                             "/home/wangtao/nfs_install.sh")
        print(res)

    def test_tar_and_copy_to_local(self):
        self.client.tar_and_copy_to_local("/hummer/test",
                                          "/home/wangtao/test/test.tar")

    def test_copy_file_to_remote_and_untar(self):
        self.client.copy_file_to_remote_and_untar(
            "/home/wangtao/test/test.tar", "/hummer/test")