Commit 88f5ab4e authored by Benjamin Blanc's avatar Benjamin Blanc

Up

parent 9d28651f
......@@ -55,7 +55,8 @@ class ScalabilityTestRunner():
# Create the slapos account configuration file and dir
key = self.testnode.test_suite_portal.getSlaposAccountKey()
certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate()
SlapOSControler.createSlaposConfigurationFileAccount(key,certificate)
self.slapos_controler.createSlaposConfigurationFileAccount(key,certificate,
self.testnode.config, self.testnode.log)
# {'COMPX' : ['soft_path1.cfg', 'soft_path2.cfg'],
# 'COMPY' : ['soft_path1.cfg'], ... }
......
......@@ -68,9 +68,9 @@ class SlapOSControler(object):
self.log = log
self.proxy_database = os.path.join(working_directory, 'proxy.db')
def createSlaposConfigurationFileAccount(key, certificate):
def createSlaposConfigurationFileAccount(self, key, certificate, config, log):
# Create "slapos_account" directory in the "slapos_directory"
slapos_account_directory = os.path.join(self.config['slapos_directory'], "slapos_account")
slapos_account_directory = os.path.join(config['slapos_directory'], "slapos_account")
SlapOSControler.createFolder(slapos_account_directory)
# Create slapos-account files
slapos_account_key_path = os.path.join(slapos_account_directory, "key")
......@@ -78,12 +78,15 @@ class SlapOSControler(object):
configuration_file_path = os.path.join(slapos_account_directory, "slapos.cfg")
configuration_file_value = "[slapos]\nmaster_url = %s\n\
[slapconsole]\ncert_file = %s\nkey_file = %s" %(
self.config['server_url'],
config['server_url'],
slapos_account_certificate_path,
slapos_account_key_path)
SlapOSControler.createFile(slapos_account_key_path, "w", key)
log("% created.", slapos_account_key_path)
SlapOSControler.createFile(slapos_account_certificate_path, "w", certificate)
log("% created.", slapos_account_certificate_path)
SlapOSControler.createFile(configuration_file_path, "w", configuration_file_value)
log("% created.", configuration_file_path)
self.configuration_file_path = configuration_file_path
def supply(self, software_url, computer_id, remove=False):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment