def this_host(request): """Fixture for the current master""" tracker = HostTracker(name=api.env.host.partition('.')[0], fqdn=api.env.host) # This host is not created/deleted, so don't call make_fixture tracker.exists = True return tracker
def this_host(request): """Fixture for the current master""" tracker = HostTracker(name=api.env.host.partition('.')[0], fqdn=api.env.host) tracker.exists = True # Finalizer ensures that any certificates added to this_host are removed tracker.add_finalizer_certcleanup(request) # This host is not created/deleted, so don't call make_fixture return tracker
def test_raise_limit_and_try_valid_len_hostname(self): """Raise limit above default and test hostname with length in between default 64 and the new value. Should pass""" testhost = HostTracker(name=u'testhost', fqdn=u'{}'.format( self.generate_hostname(MAXHOSTNAMELEN + 1))) self.modify_config_maxhostname(testhost, MAXHOSTNAMELEN * 2) testhost.create() testhost.ensure_missing()
def test_try_hostname_length_below_maximum(self): """Try to create host with valid hostname. Should pass""" valid_length = MAXHOSTNAMELEN // 2 testhost = HostTracker(name=u'testhost', fqdn=u'{}'.format( self.generate_hostname(valid_length))) self.modify_config_maxhostname(testhost, MAXHOSTNAMELEN) testhost.create() testhost.ensure_missing()
def test_try_hostname_length_above_maxhostnamelimit(self): """Try to create host with hostname length above hostnamelength limit. Should fail""" testhost = HostTracker(name=u'testhost', fqdn=u'{}'.format( self.generate_hostname(MAXHOSTNAMELEN + 1))) self.modify_config_maxhostname(testhost, MAXHOSTNAMELEN) with raises_exact(errors.ValidationError( name=u'hostname', error=u'can be at most {} characters'.format( MAXHOSTNAMELEN))): testhost.create() testhost.ensure_missing()
def test_raise_limit_above_and_try_hostname_len_above_limit(self): """Raise limit above default and try to create host with hostname length above the new-set limit. Should fail""" testhost = HostTracker(name=u'testhost', fqdn=u'{}'.format( self.generate_hostname(MAXHOSTNAMELEN * 3))) self.modify_config_maxhostname(testhost, MAXHOSTNAMELEN * 2) with raises_exact(errors.ValidationError( name='hostname', error=u'can be at most {} characters'.format( MAXHOSTNAMELEN * 2))): testhost.create() testhost.ensure_missing()
def managing_host(request): tracker = HostTracker(name=u'managinghost2', fqdn=fqdn2) return tracker.make_fixture(request)
def host5(request): tracker = HostTracker(u'webserver5') return tracker.make_fixture(request)
def host4(request): tracker = HostTracker(name=u'testhost4') return tracker.make_fixture(request)
def host(request): tr = HostTracker('iptest') return tr.make_fixture(request)
def host3(request): tracker = HostTracker(u'web5') return tracker.make_fixture(request)
def santest_host_2(request): tr = HostTracker(u'santest-host-2') return tr.make_fixture(request)
def krbalias_host(request): tracker = HostTracker(u'testhost-krb') return tracker.make_fixture(request)
def ipv46both_host(request): name = u'testipv4and6host' tracker = HostTracker(name=name, fqdn=u'%s.%s' % (name, dnszone)) return tracker.make_fixture(request)
def krb_service_host(request): tracker = HostTracker(u'krb-srv-host') return tracker.make_fixture(request)
def lab_host(request): name = u'testhost1' tracker = HostTracker(name=name, fqdn=u'%s.lab.%s' % (name, api.env.domain)) return tracker.make_fixture(request)
def host2(request, xmlrpc_setup): tr = HostTracker(host2_shortname) return tr.make_fixture(request)
def indicators_host(request): tracker = HostTracker(name=u'testhost1', fqdn=fqdn1) return tracker.make_fixture(request)
def host(request): tracker = HostTracker(name=u'host') return tracker.make_fixture(request)
def host1(request, xmlrpc_setup): tracker = HostTracker(u'web1') return tracker.make_fixture(request)
def invalid_host(request): tracker = HostTracker(name='foo_bar',) return tracker.make_fixture(request)
def host1(request): tracker = HostTracker(name=u"host1") return tracker.make_fixture(request)
def host1(request, xmlrpc_setup): tracker = HostTracker(name=u'host1') return tracker.make_fixture(request)
def ipv4only_host(request, xmlrpc_setup): name = u'testipv4onlyhost' tracker = HostTracker(name=name, fqdn=u'%s.%s' % (name, dnszone)) return tracker.make_fixture(request)
def ipv6_fromip_host(request): name = u'testipv6fromip' tracker = HostTracker(name=name, fqdn=u'%s.%s' % (name, dnszone)) return tracker.make_fixture(request)
def krb_host(request): tracker = HostTracker(u'krb-host') return tracker.make_fixture(request)
def host2(request): tracker = HostTracker(u'dev1') return tracker.make_fixture(request)
def santest_host_1(request, xmlrpc_setup): tr = HostTracker(u'santest-host-1') return tr.make_fixture(request)
def host4(request): tracker = HostTracker(u'www5') return tracker.make_fixture(request)
def host(request, xmlrpc_setup): tr = HostTracker('iptest') return tr.make_fixture(request)
def invalid_host(request): tracker = HostTracker(name='foo_bar', ) return tracker.make_fixture(request)