def main(): parser = argparse.ArgumentParser( epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument( 'url', nargs='?', default=None, help='URL of target appliance, e.g. "https://ip_or_host/"') parser.add_argument( '--num-sec', default=600, type=int, dest='num_sec', help= 'Maximum number of seconds to wait before giving up, default 600 (10 minutes)' ) args = parser.parse_args() if args.url: ip_a = IPAppliance.from_url(args.url) else: ip_a = IPAppliance() result = ip_a.wait_for_web_ui(timeout=args.num_sec) if not result: return 1
def test_context_hack(monkeypatch): ip_a = IPAppliance.from_url('http://127.0.0.2/') def not_good(*k): raise RuntimeError() monkeypatch.setattr(ip_a, '_screenshot_capture_at_context_leave', not_good) with pytest.raises(ValueError): with ip_a: raise ValueError("test")
def main(): parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('hostname', nargs='?', default=None, help='hostname or ip address of target appliance') parser.add_argument('start', action="store_true", default=False, help='Start Merkyl?') args = parser.parse_args() if args.hostname is not None: ip_a = IPAppliance(args.hostname) else: ip_a = IPAppliance.from_url() ip_a.deploy_merkyl(args.start)
def main(): parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('url', nargs='?', default=None, help='URL of target appliance, e.g. "https://ip_or_host/"') parser.add_argument('--num-sec', default=600, type=int, dest='num_sec', help='Maximum number of seconds to wait before giving up, default 600 (10 minutes)') args = parser.parse_args() if args.url: ip_a = IPAppliance.from_url(args.url) else: ip_a = IPAppliance() result = ip_a.wait_for_web_ui(timeout=args.num_sec) if not result: return 1
def main(): parser = argparse.ArgumentParser( epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('hostname', nargs='?', default=None, help='hostname or ip address of target appliance') parser.add_argument('start', action="store_true", default=False, help='Start Merkyl?') args = parser.parse_args() if args.hostname is not None: ip_a = IPAppliance(args.hostname) else: ip_a = IPAppliance.from_url() ip_a.deploy_merkyl(args.start)
def test_ipappliance_from_url(): address = '1.2.3.4' url = 'http://{}/'.format(address) ip_a = IPAppliance.from_url(url) assert ip_a.url == url assert ip_a.address == address
def test_ipappliance_from_url(): address = '1.2.3.4' url = 'http://%s/' % address ip_a = IPAppliance.from_url(url) assert ip_a.url == url assert ip_a.address == address