예제 #1
0
def execute_tests():

    total_cmds_executed = 0
    total_cmds_passed = 0
    total_cmds_failed = 0
    line_decoration = "\n______________________________________________________________________________\n"

    ExecutionOutput = "../AUTOMATION_RESULTS/" + "ExecutionOutput_PRIVATENETWORKS.txt"
    output_file = open(ExecutionOutput, "w")
    session = functions_potash.ssh_connect(UserInput.POTASHIP, UserInput.USERNAME, UserInput.PASSWORD)

    output_file.write(line_decoration + "PRIVATENETWORKS FUNCTIONAL TESTS" + line_decoration)

    cmd_output = functions_potash.execute_cmd(session, "show firmware version")
    output_file.write(cmd_output)

    output_file.write(line_decoration + "\n")
    total_cmds_passed, total_cmds_failed = privatenetworks_vlan_test(session, output_file, total_cmds_executed, total_cmds_passed, total_cmds_failed, 'Enable')
    output_file.write(line_decoration + "\n")

    total_cmds_passed, total_cmds_failed = privatenetworks_vlan_test(session, output_file, total_cmds_executed, total_cmds_passed, total_cmds_failed, 'Disable')
    output_file.write(line_decoration + "\n")

    total_cmds_passed, total_cmds_failed = newly_created_vlan_privatenetworks_test(session, output_file, total_cmds_executed, total_cmds_passed, total_cmds_failed)
    output_file.write(line_decoration + "\n")

    total_cmds_passed, total_cmds_failed = reset_privatenetworks_feature(session, output_file, total_cmds_executed, total_cmds_passed, total_cmds_failed)
    output_file.write(line_decoration + "\n")

    functions_potash.final_output(output_file, ExecutionOutput, total_cmds_executed, total_cmds_passed, total_cmds_failed)
def execute_tests():
    ExecutionOutput = "../AUTOMATION_RESULTS/" + "ExecutionOutput_AUDITLOGGING.txt"
    output_file = open(ExecutionOutput, "w")
    session = functions_potash.ssh_connect(UserInput.POTASHIP,
                                           UserInput.USERNAME,
                                           UserInput.PASSWORD)

    total_cmds_executed = 0
    total_cmds_passed = 0
    total_cmds_failed = 0

    output_file.write(spaces + "AUDITLOGGING FUNCTIONAL TESTS" + spaces)

    cmd_output = functions_potash.execute_cmd(session, "show firmware version")
    output_file.write(cmd_output)

    output_file.write(spaces + "\n")
    total_cmds_passed, total_cmds_failed = auditlogging_reset_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    session = functions_potash.ssh_connect(UserInput.POTASHIP,
                                           UserInput.USERNAME,
                                           UserInput.PASSWORD)
    total_cmds_passed, total_cmds_failed = auditlogging_enable_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed, session = auditlogging_disable_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    functions_potash.final_output(output_file, ExecutionOutput,
                                  total_cmds_executed, total_cmds_passed,
                                  total_cmds_failed)
def auditlogging_disable_test(session, output_file, total_cmds_executed,
                              total_cmds_passed, total_cmds_failed):
    cmd_output = functions_potash.execute_cmd(session, "configure terminal")
    output_file.write(cmd_output)
    print cmd_output

    cmd_output = functions_potash.execute_cmd(session, "audit-logging reset")
    output_file.write(cmd_output)
    print cmd_output

    cmd_output = functions_potash.execute_cmd(session, "audit-logging disable")
    output_file.write(cmd_output)
    print cmd_output

    cmd_output = functions_potash.execute_cmd(session, "end")
    output_file.write(cmd_output)
    print cmd_output

    cmd_output = functions_potash.execute_cmd(session, "show audit")
    output_file.write(cmd_output)
    print cmd_output

    return_value = functions_potash.execute_exit_cmd(session, "exit")
    output_file.write(return_value)

    session = functions_potash.ssh_connect(UserInput.POTASHIP,
                                           UserInput.USERNAME,
                                           UserInput.PASSWORD)

    cmd_output = functions_potash.execute_cmd(session, "show audit")
    output_file.write(cmd_output)
    print cmd_output

    if (("INFO: Audit:OneView Logging out ...! SUCCESS SSH" not in cmd_output)
            and
        ("INFO: Audit:OneView Logging in ...! SUCCESS SSH" not in cmd_output)):
        total_cmds_passed = total_cmds_passed + 1
        result = "\n" + " AUDITLOGGING DISABLE TEST" + "=Passed\n" + "\nPASSED\n"
    else:
        total_cmds_failed = total_cmds_failed + 1
        result = "\n" + " AUDITLOGGING DISABLE TEST" + "=Failed=" + "Failed in Output Validation\n" + "\nFAILED\n"
    output_file.write(result)

    return (total_cmds_passed, total_cmds_failed, session)
def execute_tests():
    ExecutionOutput = "../AUTOMATION_RESULTS/" + "ExecutionOutput_SNMPV3ENHANCEMENTS.txt"
    output_file = open(ExecutionOutput, "w")
    session = functions_potash.ssh_connect(UserInput.POTASHIP,
                                           UserInput.USERNAME,
                                           UserInput.PASSWORD)

    total_cmds_executed = 0
    total_cmds_passed = 0
    total_cmds_failed = 0

    output_file.write(spaces + "SNMPV3ENHANCEMENTS FUNCTIONAL TESTS" + spaces)

    cmd_output = functions_potash.execute_cmd(session, "show firmware version")
    output_file.write(cmd_output)

    output_file.write(spaces + "\n")
    total_cmds_passed, total_cmds_failed = snmp_targetparams_engineid_v3auth_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = snmp_targetparams_engineid_v3noauth_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = snmp_targetparams_engineid_v3priv_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = snmp_notify_notification_type_inform_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    functions_potash.final_output(output_file, ExecutionOutput,
                                  total_cmds_executed, total_cmds_passed,
                                  total_cmds_failed)
예제 #5
0
def execute_tests():
    ExecutionOutput = "../AUTOMATION_RESULTS/" + "ExecutionOutput_1GBSUPPORT.txt"
    output_file = open(ExecutionOutput, "w")
    session = functions_potash.ssh_connect(UserInput.POTASHIP,
                                           UserInput.USERNAME,
                                           UserInput.PASSWORD)

    total_cmds_executed = 0
    total_cmds_passed = 0
    total_cmds_failed = 0

    output_file.write(spaces + "1GBSUPPORT FUNCTIONAL TESTS" + spaces)

    cmd_output = functions_potash.execute_cmd(session, "show firmware version")
    output_file.write(cmd_output)

    output_file.write(spaces + "\n")
    total_cmds_passed, total_cmds_failed = autosplit_status_with_le_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = show_transceiver_info_show_interface_status_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = no_negotiation_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    total_cmds_passed, total_cmds_failed = negotiation_test(
        session, output_file, total_cmds_executed, total_cmds_passed,
        total_cmds_failed)
    output_file.write(spaces + "\n")

    functions_potash.final_output(output_file, ExecutionOutput,
                                  total_cmds_executed, total_cmds_passed,
                                  total_cmds_failed)