def config_testsuite(): """Loads an initial config from ``testsuite.cfg``. This is meant to be used as/from a pytest fixture, but isn't declared here as such; individual modules should declare fixtures which use it. Tests which don't care about a specific configuration should leave the config alone. This allows the developer to test with different configurations, e.g. different DBMS backends. if testsuite.cfg doesn't exist, sane defaults are provided. """ # NOTE: The file ``testsuite.cfg.default`` Should be updated whenever # The default settings here are modified. if os.path.isfile('testsuite.cfg'): config.load('testsuite.cfg') else: config_set({ 'extensions': { # Use the null network allocator and auth plugin by default: 'haas.ext.network_allocators.null': '', 'haas.ext.auth.null': '', }, 'devel': { 'dry_run': True, }, 'headnode': { 'base_imgs': 'base-headnode, img1, img2, img3, img4', }, 'database': { 'uri': 'sqlite:///:memory:', } })
def config_testsuite(): """Loads an initial config from ``testsuite.cfg``. This is meant to be used as/from a pytest fixture, but isn't declared here as such; individual modules should declare fixtures which use it. Tests which don't care about a specific configuration should leave the config alone. This allows the developer to test with different configurations, e.g. different DBMS backends. if testsuite.cfg doesn't exist, sane defaults are provided. """ # NOTE: The file ``testsuite.cfg.default`` Should be updated whenever # The default settings here are modified. if os.path.isfile("testsuite.cfg"): config.load("testsuite.cfg") else: config_set( { "extensions": { # Use the null network allocator and auth plugin by default: "haas.ext.network_allocators.null": "", "haas.ext.auth.null": "", }, "devel": {"dry_run": True}, "headnode": {"base_imgs": "base-headnode, img1, img2, img3, img4"}, "database": {"uri": "sqlite:///:memory:"}, } )
def config_testsuite(): """Loads an initial config from ``testsuite.cfg``. This is meant to be used as/from a pytest fixture, but isn't declared here as such; individual modules should declare fixtures which use it. Tests which don't care about a specific configuration should leave the config alone. This allows the developer to test with different configurations, e.g. different DBMS backends. if testsuite.cfg doesn't exist, sane defaults are provided. """ # NOTE: The file ``testsuite.cfg.default`` Should be updated whenever # The default settings here are modified. if os.path.isfile('testsuite.cfg'): config.load('testsuite.cfg') else: config_set({ 'extensions': { # Use the null network allocator for these tests 'haas.ext.network_allocators.null': '', }, 'devel': { 'dry_run': True, }, 'headnode': { 'base_imgs': 'base-headnode, img1, img2, img3, img4', }, 'database': { 'uri': 'sqlite:///:memory:', } })
def main(): """Entry point to the CLI. There is a script located at ${source_tree}/scripts/haas, which invokes this function. """ config.load() config.configure_logging() if len(sys.argv) < 2 or sys.argv[1] not in command_dict: # Display usage for all commands help() else: command_dict[sys.argv[1]](*sys.argv[2:])