log.error("     update_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      update_test(): PASS\n")

for i in range(3):
    try:
        log.info("Verifying destroy functionality...")
        log.debug(
            "     destroy_target() the ELB gateway first...")  # Mantis (13255)
        tf.destroy_target("gateway", "aws_ldap_duo_gw")
        log.debug("Sleeping for 3 minutes to wait for gateway clean-up...")
        time.sleep(180)
        log.debug("     Now running destroy_test() to finish clean-up...")
        tf.destroy_test()
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        if i == 2:
            log.info("-------------------- RESULT --------------------")
            log.error("     destroy_test(): FAIL\n")
            sys.exit(1)
    else:
        log.info("-------------------- RESULT --------------------")
        log.info("      destroy_test(): PASS\n")

log.info("Continuing to AWS GovCloud testing...")
log.info("\n")
log.info("============================================================")
log.debug("RUNNING STAGE: AWS GOVCLOUD LDAP/DUO GATEWAY")
log.info("============================================================")
        break

for j in range(3):
    try:
        log.debug("     destroy_target() the other ELB gateway...")
        tf.destroy_target("gateway", "r53_gw_1")
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        time.sleep(60 + 60*j)
        if j == 2:
            return_result("destroy_test", False)
            sys.exit(1)
    else:
        log.debug("Sleeping for 1 minute...")
        time.sleep(60)
        break

for k in range(3):
    try:
        log.debug("     Now running destroy_test() to finish clean-up...")
        tf.destroy_test()
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        time.sleep(60 + 60*k)
        if k == 2:
            return_result("destroy_test", False)
            sys.exit(1)
    else:
        return_result("destroy_test", True)
        sys.exit(0)
try:
    log.info("Verifying update functionality...")
    log.debug(
        "      switchProj_cred: Switching GCP credentials to another GCP account..."
    )
    tf.update_test(varfile=cred_path2)
    log.debug(
        "     gcloud_acc_cred: Switching GCP credentials back to original...")
    tf.update_test(varfile=cred_path)
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     update_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      update_test(): PASS\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test(varfile=cred_path)
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #4
0
try:
    log.info("Verifying import functionality...")
    tf.import_test("account", "aws_gov_root_1", "awsgov_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     import_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      import_test(): PASS\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("awsgov_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #5
0
    log.info("-------------------- RESULT --------------------")
    log.error("     create_verify(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      create_verify(): PASS\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support import functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     import_test(): SKIPPED\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("aws_root_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #6
0
try:
    log.info("Creating infrastructure...")
    tf.create_verify("oracle_acc_cred")
except:
    log.info("-------------------- RESULT --------------------")
    log.error("     create_verify(): FAIL\n")
    sys.exit()
log.info("-------------------- RESULT --------------------")
log.info("      create_verify(): PASS\n")


log.info(str(os.path.split(os.getcwd())[1]).upper() + " does not support import functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     import_test(): SKIPPED\n")


log.info(str(os.path.split(os.getcwd())[1]).upper() + " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")


try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("oracle_acc_cred")
except:
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit()
log.info("-------------------- RESULT --------------------")
log.info("      destroy_test(): PASS\n")
try:
    log.info("Verifying update functionality...")
    log.debug(
        "      switchProj_cred: Switching GCP credentials to another GCP account..."
    )
    tf.update_test("switchProj_cred")
    log.debug(
        "     gcloud_acc_cred: Switching GCP credentials back to original...")
    tf.update_test("gcloud_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     update_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      update_test(): PASS\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("gcloud_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #8
0
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     import_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      import_test(): PASS\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")

for i in range(3):
    try:
        log.info("Verifying destroy functionality...")
        tf.destroy_test(timeout=1200)
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        time.sleep(60 + 60 * i)
        if i == 2:
            log.info("-------------------- RESULT --------------------")
            log.error("     destroy_test(): FAIL\n")
            sys.exit(1)
    else:
        log.info("-------------------- RESULT --------------------")
        log.info("      destroy_test(): PASS\n")
        sys.exit(0)
Example #9
0
try:
    log.info("Verifying import functionality...")
    tf.import_test("account_user", "test_accountuser", "acc_user_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     import_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      import_test(): PASS\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("acc_user_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #10
0
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      import_test(): PASS\n")

try:
    log.info("Verifying update functionality...")
    log.debug(
        "     switchApp: Switching Azure credentials to another Azure account..."
    )
    tf.update_test("switchApp_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     update_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      update_test(): PASS\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("switchApp_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
    try:
        log.debug("Verifying import functionality for Azure...")
        log.debug("     Verifying import for Azure transit firenet gateway...")
        tf.import_test("transit_gateway", "azure_transit_firenet_gw", varval="enable_azure=true")
        log.debug("     Verifying import for Azure transit egress gateway...")
        tf.import_test("transit_gateway", "azure_egress_firenet_gw", varval="enable_azure=true")
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        time.sleep(60 + 60*l)
        if l == 2:
            return_result("Azure_import_test", False)
            sys.exit(1)
    else:
        return_result("Azure_import_test", True)
        break


for m in range(3):
    try:
        log.info("Verifying destroy functionality...")
        tf.destroy_test(varval="enable_azure=true")
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        time.sleep(60 + 60*m)
        if m == 2:
            return_result("destroy_test", False)
            sys.exit(1)
    else:
        return_result("destroy_test", True)
        sys.exit(0)
    log.info("-------------------- RESULT --------------------")
    log.error("     create_verify(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      create_verify(): PASS\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support import functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     import_test(): SKIPPED\n")

log.info(
    str(os.path.split(os.getcwd())[1]).upper() +
    " does not support update functionality...")
log.info("-------------------- RESULT --------------------")
log.info("     update_test(): SKIPPED\n")

try:
    log.info("Verifying destroy functionality...")
    tf.destroy_test("aws_iam_acc_cred")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     destroy_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      destroy_test(): PASS\n")
Example #13
0
    tf.update_test("removeUser", "user_emails")
except tf.subprocess.CalledProcessError as err:
    log.exception(err.stderr.decode())
    log.info("-------------------- RESULT --------------------")
    log.error("     update_test(): FAIL\n")
    sys.exit(1)
else:
    log.info("-------------------- RESULT --------------------")
    log.info("      update_test(): PASS\n")


for i in range(3):
    try:
        log.info("Verifying destroy functionality for both VPN users and profiles...")
        log.debug("     destroy_target() the VPN gateway first...") # Mantis (13255)
        tf.destroy_target("gateway", "vpn_user_gw", "user_emails")
        log.debug("Sleeping for 3 minutes to wait for gateway clean-up...")
        time.sleep(180)
        log.debug("     Now running destroy_test() to finish clean-up...")
        tf.destroy_test("user_emails")
    except tf.subprocess.CalledProcessError as err:
        log.exception(err.stderr.decode())
        if i == 2:
            log.info("-------------------- RESULT --------------------")
            log.error("     destroy_test(): FAIL\n")
            sys.exit(1)
    else:
        log.info("-------------------- RESULT --------------------")
        log.info("      destroy_test(): PASS\n")
        sys.exit(0)