Пример #1
0
def sees():

    signal.signal(signal.SIGINT, signal_handler)

    main = Main()
    while True:
        mess = bcolors.FAIL + disclamer + bcolors.ENDC + " : "
        sys.stdout.write(mess)

        if not main.args.warning:
            agree = raw_input()
            if (agree == "Y" or agree == "y"):
                try:
                    main.run()
                except Exception, err:
                    print >> sys.stderr, err
                    sys.exit(1)
            elif (agree == "N" or agree == "n"):
                print >> sys.stderr, message
                sys.exit(1)
            else:
                print >> sys.stderr, wrong_option
        else:
            try:
                main.run()
            except Exception, err:
                print >> sys.stderr, err
                sys.exit(1)
Пример #2
0
def main():
    try:
        crowbar = Main()
        crowbar.run(crowbar.args.brute)
    except Exception as err:
        import sys

        print(err, file=sys.stderr)
        sys.exit(1)
Пример #3
0
    def __init__(self, dbInstance, unity, sMode, sProtocol):
        self.cap = dbInstance
        self.unity = unity
        self.main = Main(self.cap, self.unity)
        self.sMode = sMode
        self.protocols = []

        ### Switch to dict when newer protocols are implemented
        if sProtocol is not None:
            self.protocols.append(sProtocol)
            self.dhcp = Dhcp(self.cap, self.unity)
Пример #4
0
def multi_run(sit):
    if sit in HOST_INFO:
        host = HOST_INFO.get(sit)
    else:
        print('请输入正确的环境名称,环境有:\n' 'dev:开发环境\n' 'test:测试环境\n' 'pre:预生产环境')
        return
    for case_file in os.listdir(CASE_PATH):
        if case_file.endswith('.xls') or case_file.endswith('.xlsx'):
            abs_case_file = os.path.join(CASE_PATH, case_file)
            my_test = Main(abs_case_file, host)
            t = threading.Thread(target=my_test.main)
            t.start()
Пример #5
0
def single_run(sit):
    '''
	单线程运行
	:return:
	'''
    if sit in HOST_INFO:
        host = HOST_INFO.get(sit)
    else:
        print('请输入正确的环境名称,环境有:' 'dev:开发环境' 'test:测试环境' 'pre:预生产环境')
        return
    for case_file in os.listdir(CASE_PATH):
        if case_file.endswith('.xls') or case_file.endswith('.xlsx'):
            abs_case_file = os.path.join(CASE_PATH, case_file)
            my_test = Main(abs_case_file, host)
            my_test.main()
Пример #6
0
def sees():
    main = Main()

    while True:
        print >> sys.stdout, bcolors.FAIL + disclamer + bcolors.ENDC
        agree = raw_input()
        if (agree == "Y" or agree == "y"):
            try:
                try:
                    main.run()
                except Exception, mess:
                    print mess
                    sys.exit(2)
            except KeyboardInterrupt:
                print message
                sys.exit(3)
        elif (agree == "N" or agree == "n"):
            print message
            sys.exit(4)
        else:
            print wrong_option
Пример #7
0
#!/usr/bin/python
try:
    from lib.main import Main
except ImportError, err:
    from lib.core.core import Core
    Core.print_error(err)

## open your eyes

if __name__ == "__main__":

    winose = Main()
    winose._run()
Пример #8
0
#!/usr/bin/env python2

try:
    from lib.main import Main
    from lib.core.exceptions import CrowbarExceptions
except Exception, err:
    import sys
    print >> sys.stderr, err
    sys.exit(1)

##
### Main
##

if __name__ == "__main__":

    try:
        crowbar = Main()
        crowbar.run(crowbar.args.brute)
    except Exception, err:
        import sys
        print >> sys.stderr, err
        sys.exit(1)
argsParser.add_argument( "--browser", help = "Browser to run, e.g. \"chrome\", \"firefox\", \"internetexplorer\", \"edge\"", required = True )
argsParser.add_argument( "--browser-version", help = "Version of browser" )
argsParser.add_argument( "--screen-resolution", help = "Screen resolution, default: 1024x768", default = "1024x768" )
argsParser.add_argument( "--framework", help = "Javascript test framework used", required = True, choices = [ "jasmine", "qunit" ] )
argsParser.add_argument( "--max-duration", help = "Maximum tests duration in seconds, default: 300.", type = int, default = 300 )
argsParser.add_argument( "--tunnel-id", help = "SauceLabs tunnel identifier." )
argsParser.add_argument( "--output", help = "Filename to store JUnit xml results." )
argsParser.add_argument( "--nosandbox", help = "Option for Chrome webdriver: disables sandbox." )

args = argsParser.parse_args()

print "Arguments:"
print args

from lib.main import Main

Main(

  seleniumServer = args.selenium_server,
  testsUrl = args.tests_url,
  platform = args.platform,
  browser = args.browser,
  browserVersion = args.browser_version,
  screenResolution = args.screen_resolution,
  framework = args.framework,
  maxDuration = args.max_duration,
  tunnelId = args.tunnel_id,
  output = args.output,
  nosandbox = args.nosandbox
)
argsParser.add_argument( "--output", help = "Filename to store JUnit xml results." )
argsParser.add_argument( "--chrome-options", help = "Options for Chrome webdriver separated by commas, example: --chrome-options=\"--js-flags=--expose-gc,--enable-precise-memory-info\"" )
argsParser.add_argument( "--prerun-script-url", help = "Url of the script executed before run." )
argsParser.add_argument( "--one-by-one", action = "store_true", help = "Run tests one by one." )
argsParser.add_argument( "--avoid-proxy", action = "store_true", help = "Configures Sauce Labs to avoid using the  Selenium HTTP proxy server and have browsers communicate directly with your servers. Firefox and Google Chrome under WebDriver aren't affected by this flag." )

args = argsParser.parse_args()

print "Arguments:"
print args

from lib.main import Main

Main(

  testsUrl = args.tests_url,
  browser = args.browser,
  framework = args.framework,
  seleniumServer = args.selenium_server,
  platform = args.platform,
  browserVersion = args.browser_version,
  screenResolution = args.screen_resolution,
  maxDuration = args.max_duration,
  tunnelId = args.tunnel_id,
  output = args.output,
  chromeOptions = args.chrome_options,
  prerunScriptUrl = args.prerun_script_url,
  oneByOne = args.one_by_one,
  avoidProxy = args.avoid_proxy
)
Пример #11
0
#!/usr/bin/python

__VERSION__ = '0.3'
__AUTHOR__ = 'Galkan'
__DATE__ = '2014'

try:
    from lib.main import Main
except ImportError, e:
    import sys
    sys.stdout.write("%s\n" % e)
    sys.exit(1)

if __name__ == '__main__':

    main = Main()
    main.run()
Пример #12
0
#!/usr/bin/python

try:
    from lib.main import Main
except ImportError, err:
    from lib.core.core import Core
    Core.print_error(err)

##
### Main, go Galkan go go go ...
##

if __name__ == "__main__":

    flashlight = Main()
    flashlight._run(flashlight._args.scan_type)
Пример #13
0
def create_all(config, source_file):
  """Creates topics, queues and subscriptions."""
  Main(config).create_all(source_file)
Пример #14
0
#!/usr/bin/env python

__VERSION__ = '0.1'
__AUTHOR__ = 'Galkan'
__DATE__ = '16.07.2014'

try:
    from lib.main import Main
except ImportError, e:
    import sys
    sys.stdout.write("%s\n" % e)
    sys.exit(1)

##
### Main, go Galkan go go go ...
##

if __name__ == "__main__":

    fener = Main()
    fener.run(fener.args.scan_type)
Пример #15
0
def create_subscriptions(config, source_file):
  """Create all subscriptions"""
  Main(config).create_subscriptions(source_file)
Пример #16
0
def create_topics(config, source_file):
  """Create all aws topics"""
  Main(config).create_topics(source_file)
Пример #17
0
def create_queues(config, source_file):
  """Create all aws queues"""
  Main(config).create_queues(source_file)
Пример #18
0
def describe(config, source_file):
  """Shows what queues and topics will be created."""
  Main(config).describe(source_file)
Пример #19
0
#!/usr/bin/env python

__VERSION__ = '0.1'
__AUTHOR__ = 'Galkan'
__DATE__ = '16.07.2014'

try:
	from lib.main import Main
except ImportError,e:
        import sys
        sys.stdout.write("%s\n" %e)
        sys.exit(1)


##
### Main, go Galkan go go go ...
##

if __name__ == "__main__":

	levye = Main()
	levye.run(levye.args.brute)