示例#1
0
    def preTest( self ):
        """
        Sets up the test environment
        """
        from lib import distrodetermine

        # Run the tests against the proper distro, shouldn't fake this
        self.na_setup_config['distro_info'] = distrodetermine.whichDistro()
        
        self.parseCmdLine()
        return
示例#2
0
    def run(self):
        self.console.prints('Setting up LDAP... '),

        if self.ldapDaemon.isRunning():
            self.ldapDaemon.stop()

        # Run the pre-setup hooks
        distro_info = distrodetermine.whichDistro()

        try:
            exec("import distrohooks.%s_pre_ldap" %distro_info['distro'])
            exec("preHook = distrohooks.%s_pre_ldap.PreHook(self.na_setup_config, self.app_paths)" %
                    distro_info['distro'])
        except Exception, info:
            raise PreHookError(info)
示例#3
0
    def run(self):
        """
        naSetup API call.  Runs all the appropriate methods in the class to set saslauthd up.

        :return: Modified naSetup configuration dictionary.

        """
        self.console.prints('Setting up SASL... '),

        # Run the pre-setup hooks
        distroInfo = distrodetermine.whichDistro()

        try:
            exec("from lib.nasetup.distrohooks.%s import pre_sasl" %distroInfo['distro'])
            exec("self.preHook = pre_sasl.PreHook(self.na_setup_config, self.app_paths)")
        except Exception, info:
            raise PreHookFailedError(info)
示例#4
0
    def __init__(self, na_setup_config, quiet_run = False):
        """
        Constructor
        
        :param na_setup_config: Setup config dict built by autoinstall or userinput
        :param quiet_run:  Silences console output if ``True``.  Defaults to ``False``.

        """
        self.na_setup_config = na_setup_config
        self.app_paths = app_paths
        self.quiet = quiet_run
        self.console = console.Console(quiet_run)
        self.configFiles = nixconfigfiles.NixConfigFiles(no_auto_parse = True)

        if not self.na_setup_config['hostName']:
            raise InvalidConfigError("Provided host name: %s" %self.na_setup_config['hostName'])
        if not self.na_setup_config['dnsDomain']:
            raise InvalidConfigError("Provided Domain: %s" %self.na_setup_config['dnsDomain'])

        self.rc_fq_name = "%s.%s" %(self.na_setup_config['hostName'], self.na_setup_config['dnsDomain'])
        self.realm = self.na_setup_config['dnsDomain'].upper()

        # Set up the server classes
        self.kdc = kdc.KDC()
        self.kadmin = kadmin.Kadmin(kadmin_type='kadmin.local')
        self.kerberos = nixkerberos.NixKerberos(self.realm)   # nixAuth Kerberos functions


        # Run the pre-setup hook distrohooks
        distro_info = distrodetermine.whichDistro()

        try:
            exec("from lib.nasetup.distrohooks.%s import pre_kerberos" %distro_info['name'])
            exec("self.preHook = pre_kerberos.PreHook(self.na_setup_config)")
        except Exception, info:
            raise PreHookFailedError(info)
示例#5
0
#
# DO NOT DISTRIBUTE!
# This file is used for development and testing ONLY, where there is no guarantee of the setup process having been
# run before code is executed.
#
# REMOVE THIS FILE BEFORE YOU PACKAGE!
#

import sys

# Windows is not a supported nixAuth platform, but I dev in it, so this is a fix for running tests in Windows
if sys.platform == 'win32':
    from conf.distro_config.debian.integration_config import *
else:
    from lib import distrodetermine
    distro = distrodetermine.whichDistro()
    exec('from conf.distro_config.%s.integration_config import *' %distro['name'])