当前位置: 首页>>代码示例>>Python>>正文


Python RemoteMachineShellConnection.execute_cbtransfer方法代码示例

本文整理汇总了Python中lib.remote.remote_util.RemoteMachineShellConnection.execute_cbtransfer方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteMachineShellConnection.execute_cbtransfer方法的具体用法?Python RemoteMachineShellConnection.execute_cbtransfer怎么用?Python RemoteMachineShellConnection.execute_cbtransfer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.remote.remote_util.RemoteMachineShellConnection的用法示例。


在下文中一共展示了RemoteMachineShellConnection.execute_cbtransfer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_and_restore_csv

# 需要导入模块: from lib.remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from lib.remote.remote_util.RemoteMachineShellConnection import execute_cbtransfer [as 别名]
 def create_and_restore_csv(self):
     try:
         self.__load_data()
         shell_obj = RemoteMachineShellConnection(self.master)
         self.log.info("Removing backup folder if already present")
         info = shell_obj.extract_remote_info()
         path = "/tmp/backup/"
         if info.type.lower() == "windows":
             path = "/cygdrive/c" + path
         #TODO : Check for mac also
         shell_obj.delete_files(path)
         create_dir = "mkdir " + path
         data_type = "csv:"
         destination = path + "data.csv"
         shell_obj.execute_command(create_dir)
         source = "http://localhost:8091"
         options = "-b default" + self.username_arg + self.password_arg
         shell_obj.execute_cbtransfer(source, data_type + destination, options)
         self.log.info("Created csv file @ %s" % destination)
         source, destination = destination, source
         options = "-B standard_bucket0" + self.username_arg + self.password_arg
         self.log.info("Restoring data....!")
         shell_obj.execute_cbtransfer(source, destination, options)
         self.sleep(10)
         self.log.info("Checking whether number of items loaded match with the number of items restored.")
         rest = RestConnection(self.master)
         itemCount = rest.get_bucket_json('standard_bucket0')['basicStats']['itemCount']
         self.assertEqual(itemCount, self.num_items, msg="Number of items loaded do no match\
         with the number of items restored. Number of items loaded is {0} \
         but number of items restored is {1}".format(self.num_items, itemCount))
         self.log.info("Number of items loaded = Number of items restored. Pass!!")
     finally:
         shell_obj.disconnect()
开发者ID:arod1987,项目名称:testrunner,代码行数:35,代码来源:csvdatatest.py


注:本文中的lib.remote.remote_util.RemoteMachineShellConnection.execute_cbtransfer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。