コード例 #1
0
ファイル: tasks.py プロジェクト: bopopescu/bigrobot
 def cli_launch_upgrade_pkg(self,params,**kwargs):
     def run():
         test.Test()             
         t5 = T5Platform()
         result= t5.cli_upgrade_launch_HA(**kwargs)
         return result        
     return task_execute(params, run)
コード例 #2
0
 def cli_show_version(self, params, node):
     def run():
         helpers.log("Task: cli_show_version")
         t = test.Test()
         n = t.node(node)
         content = n.cli("show version")['content']
         return content
     return task_execute(params, run)
コード例 #3
0
 def cli_show_running_config(self, params, node):
     def run():
         helpers.log("Task: cli_show_running")
         t = test.Test()
         n = t.node(node)
         content = n.enable("show running-config")['content']
         return content
     return task_execute(params, run)
コード例 #4
0
ファイル: tasks.py プロジェクト: bopopescu/bigrobot
 def cli_copy_upgrade_pkg(self,params,**kwargs):
     def run():
         helpers.log("Task: cli_copy_upgrade_pkg")
         test.Test()             
         t5 = T5Platform()
         result= t5.copy_pkg_from_server(**kwargs)        
         return result
     return task_execute(params, run)
コード例 #5
0
    def restart_switch(self, params, **kwargs):
        def run():
            helpers.log("Task: Restarting a switch")
            test.Test()
            sl = SwitchLight()
            result = sl.cli_restart_switch(**kwargs)
            return result

        return task_execute(params, run)
コード例 #6
0
    def ha_failover(self, params):
        def run():
            helpers.log("Task: perform ha fail over")
            test.Test()
            app = AppController()
            result = app.rest_execute_ha_failover()
            return result

        return task_execute(params, run)
コード例 #7
0
 def bash_ping_regression_server(self, params, node):
     def run():
         helpers.log("Task: bash_ping_regression_server")
         t = test.Test()
         _ = t.node(node)
         host = Host()
         loss_pct = host.bash_ping(node=node,
                                   dest_ip='regress.qa.bigswitch.com')
         return loss_pct
     return task_execute(params, run)
コード例 #8
0
ファイル: tasks.py プロジェクト: bopopescu/bigrobot
    def cli_show_version(self, params, node):
        """
        A simple task for testing purpose - invokes CLI command.
        """
        def run():
            helpers.log("Task: cli_show_version")
            t = test.Test()
            n = t.node(node)
            content = n.cli("show version")['content']
            return content

        return task_execute(params, run)
コード例 #9
0
    def execute_ha_failover(self, params, node):
        def run():
            '''
            Execute HA failover from master controller
            '''
            try:
                t = test.Test()
            except:
                return False
            else:
                c = t.controller('master')
                try:
                    url1 = '/rest/v1/system/ha/failback'
                    c.rest.put(url1, {})
                except:
                    helpers.test_log(c.rest.error())
                    return False
                else:
                    helpers.test_log(c.rest.content_json())
                    return True

        return task_execute(params, run)