Beispiel #1
0
def ProcessNetworkOption(option, error_message):
    user_id = ""
    if platform.system() != "Windows":
        user_id = raw_input(
            "Vaults will use default user lifestuff to run unless another is given: "
        )
    if option == "1":
        vault_procs = utils.CountProcs("lifestuff_vault")
        mgr_procs = utils.CountProcs("lifestuff_mgr")
        if vault_procs > 0 or mgr_procs > 0:
            error_message = "Already running vaults/lifestuff_mgr in this computer. Try option 2."
            return -1
        else:
            vault_count = int(
                raw_input("How many vaults would you like to run (10-50): "))
            result = client_environment.ParameterBasedStartup(
                None, None, None, None, vault_count, user_id)
            if result != 0:
                return result
    elif option == "2":
        use_local_network = -1
        ip_address = raw_input(
            "IP address of vault in the network (will use LIVE port): ")
        if client_environment.CheckPassedInIp(ip_address) != 0:
            error_message = "IP given is incomplete or incorrect."
        else:
            result = client_environment.ParameterBasedStartup(
                ip_address, None, None, None, None, user_id)
            if result != 0:
                return result

    return 0
Beispiel #2
0
def MainMenu():
    option = 'a'
    utils.ClearScreen()
    #  if utils.BuildType() == None:
    #    print ("Not a build dir please cd to build dir i.e. the location of CMakeCache.txt")
    #    return -1;
    while (option != 'q'):
        procs = utils.CountProcs('lifestuff_vault')
        print(str(procs) + " Vaults running on this machine")
        print("MaidSafe Development helper tool")
        #    print ("Using " +  utils.BuildType() + " build")
        print("================================")
        print("1: Style Check ")
        print("2: All Experimentals ")
        if utils.FindFile('cppcheck') == None:
            print("No Cppcheck installed, please install cppcheck")
            print("this will allow basic checks on c++ code")
        else:
            print("3: cppcheck (found)")
        print("4: QA Menu")
        option = raw_input("Please select an option (q to quit): ").lower()
        if (option == "1"):
            StyleCheck()
        if (option == "2"):
            RunAllExperimentals()
        if (option == "3"):
            CppCheck()
        if (option == "4"):
            QaMenu()
Beispiel #3
0
def RoutingMenu():
    option = 'a'
    utils.ClearScreen()
    while (option != 'm'):
        utils.ClearScreen()
        procs = utils.CountProcs('lifestuff_vault')
        print(str(procs) + " Vaults running on this machine")
        print("================================")
        print("MaidSafe Quality Assurance Suite | routing Actions")
        print("================================")
        print("1: Routing Sanity Checks (10 minutes average)")
        if procs == 0:
            print("2: Connect nodes to remote network")
        else:
            print("3: Feature Checks")
            print("4: Kill all routing nodes on this machine")
            print(
                "5: Random churn on this machine, rate (% churn per minute) (not yet implemented)"
            )
            print("6: Msg Send Menu")
        option = raw_input(
            "Please select an option (m for main QA menu): ").lower()
        if (option == "1"):
            SanityCheck()
        if (option == "6"):
            MsgSendingMenu()

    utils.ClearScreen()
Beispiel #4
0
def RunCheckNetwork():
    count = utils.CountProcs("lifestuff_vault")
    if count < 10:
        print "Not enough vaults:", count
        return -1

    count = utils.CountProcs("lifestuff_mgr")
    if count != 1:
        print "Wrong number of lifestuff_mgr running:", count
        return -1

    if CheckLiveUdpIsOpen() != 0:
        print "UDP port on LIVE(5483) is available. Probably means no bootstrap node."
        return -1

    return 0
Beispiel #5
0
def ClientMenu():
    option = "a"
    utils.ClearScreen()
    credentials = []
    GenerateCredentials(credentials)
    while (option != "m"):
        utils.ClearScreen()
        procs = utils.CountProcs("lifestuff_vault")
        PrintMenu(procs)
        option = raw_input(
            "Please select an option (m for main QA menu): ").lower()
        if option == "1" or option == "2" or option == "3" or option == "4" or option == "5":
            g_functions_dictionary[option](credentials)
            raw_input("Press enter to continue.")


#    elif option == "6":
#      TestChangePublicId()
#      raw_input("Press enter to continue.")
#    elif option == "7":
#      TestMultipleInstances(credentials)
#      raw_input("Press enter to continue.")
        elif option == "8":  # TODO - remove
            ShowCredentials(credentials)
            raw_input("Press enter to continue.")
        elif option == "9":  # TODO - remove
            RegenerateCredentials(credentials)
        elif option == "10":  # TODO - remove
            CheckLogInLogOut(credentials)
    utils.ClearScreen()
Beispiel #6
0
def PrintVaultMenu():
    utils.ClearScreen()
    procs = utils.CountProcs('vault')
    print(str(procs) + " Vaults running on this machine")
    print("================================")
    print("MaidSafe Quality Assurance Suite | Vault Actions")
    print("================================")
    print("1: Bootstrap and set up vaults")
    if procs == 0:
        print("2: Set up vaults only (bootstrap elsewhere)")
    else:
        print("3: Run simple test - store then fetch")
        print("4: Run simple test with delete")
        print("5: Run prolonged test - store fetch then delete")
        print("6: Store keys to network")
        print("7: Random churn on this machine")
        print("8: Kill all vaults on this machine")
    return procs
Beispiel #7
0
def main():
    if len(sys.argv) != 4:
        print("Wrong number of parameters for the test")
        return -1

    ctest_command = sys.argv[1]
    ctest_configuration = sys.argv[2]
    tools_path = sys.argv[3]

    proc_count = utils.CountProcs("lifestuff")
    if proc_count > 0:
        print "lifestuf processes running"
        return -1


#  retcode = subprocess.call([sys.executable, os.path.join(tools_path, "client_environment.py")])
#  if retcode != 0:
#    print("Failed executing lifestuff_killer.py")
#    return retcode
    retcode = client_environment.ParameterBasedStartup(None, None, None, None,
                                                       None, None)
    if retcode != 0:
        print "Failed to set up environment"
        return -1

    execution_array = [
        ctest_command, '-C', ctest_configuration, '-M', 'Experimental', '-L',
        'Lifestuff', '-T', 'Start', '-T', 'Build', '--build-noclean', '-T',
        'Test', '-T', 'Coverage', '-T', 'Submit'
    ]
    retcode = subprocess.call(execution_array)
    if retcode != 0:
        print "result of ctest execution: ", retcode

    retcode = subprocess.call(
        [sys.executable,
         os.path.join(tools_path, "lifestuff_killer.py")])
    if retcode != 0:
        print("Failed executing lifestuff_killer.py")
        return retcode

    return retcode
Beispiel #8
0
def QaMenu():
    option = 'a'
    utils.ClearScreen()
    while (option != 'm'):
        procs = utils.CountProcs('lifestuff_vault')
        print(str(procs) + " Vaults running on this machine")
        print("MaidSafe Quality Assurance Suite")
        print("================================")
        print("1: Routing:   sanity check")
        print("2: Vault:     Vault QA Menu")
        print("3: Client:    Client QA Menu")
        print("4: LifeStuff: performance (includes manager)")
        option = raw_input(
            "Please select an option (m for main menu): ").lower()
        if (option == "1"):
            routing.SanityCheck()
        if (option == "2"):
            vault.VaultMenu()
        if (option == "3"):
            client.main()
    utils.ClearScreen()
Beispiel #9
0
def PrintVaultMenu():
    utils.ClearScreen()
    procs = utils.CountProcs('vault')
    print(str(procs) + " Vaults running on this machine")
    print("================================")
    return procs