| | |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! Copyright 2007-2010 Sun Microsystems, Inc. |
| | | ! Portions Copyright 2011 ForgeRock AS. |
| | | ! Portions Copyright 2011-2013 ForgeRock AS. |
| | | ! --> |
| | | <stax> |
| | | |
| | |
| | | MultimasterSync = 'Multimaster Synchronization' |
| | | MultimasterType = 'multimaster' |
| | | |
| | | # TODO: this test flow for replication tests needs moving out to configuration |
| | | # Replication execution mode variables: if not defined, set "random" |
| | | # values: |
| | | # (day of the month % 4) == 0 --> (split servers, eclmode n/a) |
| | | # (day of the month % 4) == 1 --> (don't split, opends eclmode) |
| | | # (day of the month % 4) == 2 --> (don't split, draft eclmode) |
| | | # (day of the month % 4) == 3 --> (don't split, eclmode n/a) |
| | | import time |
| | | monthday = time.localtime()[2] |
| | | rewriteConfigFile = False |
| | | |
| | | if REPLICATION_SPLIT_SERVERS == '': |
| | | rewriteConfigFile = True |
| | | oldSplitConfig = """REPLICATION_SPLIT_SERVERS = ''""" |
| | | if monthday % 4 == 0: |
| | | REPLICATION_SPLIT_SERVERS = 'true' |
| | | else: |
| | | REPLICATION_SPLIT_SERVERS = 'false' |
| | | newSplitConfig = """REPLICATION_SPLIT_SERVERS = '%s'""" % \ |
| | | REPLICATION_SPLIT_SERVERS |
| | | else: |
| | | newSplitConfig = """REPLICATION_SPLIT_SERVERS = '%s'""" % \ |
| | | REPLICATION_SPLIT_SERVERS |
| | | oldSplitConfig = newSplitConfig |
| | | |
| | | if REPLICATION_ECL_MODE == '': |
| | | rewriteConfigFile = True |
| | | oldEclmodeConfig = """REPLICATION_ECL_MODE = ''""" |
| | | if monthday % 4 == 1: |
| | | REPLICATION_ECL_MODE = 'opends' |
| | | elif monthday % 4 == 2: |
| | | REPLICATION_ECL_MODE = 'draft' |
| | | else: |
| | | REPLICATION_ECL_MODE = 'n/a' |
| | | newEclmodeConfig = """REPLICATION_ECL_MODE = '%s'""" % \ |
| | | REPLICATION_ECL_MODE |
| | | else: |
| | | newEclmodeConfig = """REPLICATION_ECL_MODE = '%s'""" % \ |
| | | REPLICATION_ECL_MODE |
| | | oldEclmodeConfig = newEclmodeConfig |
| | | |
| | | |
| | | # Rewrite the randomly chosen variables in config.py file |
| | | if rewriteConfigFile == True : |
| | | import re |
| | | splitRegEx = re.compile(oldSplitConfig) |
| | | eclmodeRegEx = re.compile(oldEclmodeConfig) |
| | | |
| | | configFile = STAXJobScriptFiles[0] |
| | | configInput = open(configFile, 'r') |
| | | c0 = configInput.read() |
| | | c1 = splitRegEx.sub(newSplitConfig, c0) |
| | | content = eclmodeRegEx.sub(newEclmodeConfig, c1) |
| | | configInput.close() |
| | | |
| | | configOutput = open(configFile,'w') |
| | | configOutput.write(content) |
| | | configOutput.close() |
| | | |
| | | # Create staf objects |
| | | LOCAL_STAF_ROOT = test_env.staf(STAF_LOCAL_HOSTNAME).root |
| | | REMOTE_STAF_ROOT = test_env.staf(STAF_REMOTE_HOSTNAME).root |