本文整理汇总了Python中client_test_lib.Bootstrap.missing_startup_config_failure方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrap.missing_startup_config_failure方法的具体用法?Python Bootstrap.missing_startup_config_failure怎么用?Python Bootstrap.missing_startup_config_failure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client_test_lib.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.missing_startup_config_failure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import missing_startup_config_failure [as 别名]
def test(self):
open(RC_EOS, 'w').write(random_string())
open(BOOT_EXTENSIONS, 'w').write(random_string())
os.makedirs(BOOT_EXTENSIONS_FOLDER)
open('%s/%s' % (BOOT_EXTENSIONS_FOLDER, random_string()),
'w').write(random_string())
bootstrap = Bootstrap()
bootstrap.ztps.set_config_response()
bootstrap.ztps.set_node_check_response()
bootstrap.ztps.set_definition_response()
bootstrap.start_test()
try:
self.failUnless(bootstrap.eapi_node_information_collected())
self.failUnless(bootstrap.missing_startup_config_failure())
self.failIf(os.path.exists(RC_EOS))
self.failIf(os.path.exists(BOOT_EXTENSIONS))
self.failIf(os.path.exists(BOOT_EXTENSIONS_FOLDER))
self.failIf(bootstrap.error)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise assertion
finally:
bootstrap.end_test()
示例2: test
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import missing_startup_config_failure [as 别名]
def test(self):
bootstrap = Bootstrap()
open(bootstrap.rc_eos, 'w').write(random_string())
open(bootstrap.boot_extensions, 'w').write(random_string())
os.makedirs(bootstrap.boot_extensions_folder)
open('%s/%s' % (bootstrap.boot_extensions_folder,
random_string()),
'w').write(random_string())
bootstrap.ztps.set_config_response()
bootstrap.ztps.set_node_check_response()
bootstrap.ztps.set_definition_response()
bootstrap.start_test()
try:
self.failUnless(bootstrap.eapi_node_information_collected())
self.failUnless(bootstrap.missing_startup_config_failure())
self.failIf(os.path.exists(bootstrap.rc_eos))
self.failIf(os.path.exists(bootstrap.boot_extensions))
self.failIf(os.path.exists(bootstrap.boot_extensions_folder))
self.failIf(bootstrap.error)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise_exception(assertion)
finally:
bootstrap.end_test()
示例3: xmpp_sanity_test
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import missing_startup_config_failure [as 别名]
def xmpp_sanity_test(self, xmpp):
log = '/tmp/ztps-log-%s-debug' % os.getpid()
bootstrap = Bootstrap()
bootstrap.ztps.set_config_response(logging=[
{'destination' : 'file:%s' % log,
'level' : 'DEBUG'},],
xmpp=xmpp)
bootstrap.ztps.set_node_check_response()
bootstrap.ztps.set_definition_response()
bootstrap.start_test()
try:
self.failUnless(bootstrap.eapi_node_information_collected())
self.failUnless(bootstrap.missing_startup_config_failure())
self.failIf(bootstrap.error)
self.failIf('XmppClient' not in ''.join(file_log(log)))
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise assertion
finally:
bootstrap.end_test()