def main():
    Benchmark.debug()
    user = Config()["cloudmesh.profile.user"]

    name_generator = Name()
    name_generator.set(f"benchmark-{user}-vm-" + "{counter}")
    name_generator.incr()

    results = {}

    for provider in providers:
        results[provider] = {}

        for f_name in functionality_benchmark:
            results[provider][f_name] = []

            x = ComputeBenchmark(provider, f_name)

            try:
                results[provider][f_name].append(test_function(x))

            except Exception as e:
                print(e)

    #TODO use Tabulate writer to print
    print(results)

    with open('benchmark.txt', 'w') as f:
        for provider, functions in results.items():
            for function in functions.keys():
                for result in functions[function]:
                    f.write(f"{result.__str__()}\n")
Benchmark.debug()

user = Config()["cloudmesh.profile.user"]
variables = Variables()
VERBOSE(variables.dict())

cloud = variables.parameter('cloud')

print(f"Test run for {cloud}")

if cloud is None:
    raise ValueError("cloud is not not set")

name_generator = Name()
name_generator.set(f"benchmark-{user}-vm-" + "{counter}")
# name_generator.reset()

name = str(name_generator)

provider = Provider(name=cloud)


def Print():
    data = provider.list()
    print(provider.Print(data=data, output='table', kind='vm'))


current_vms = 0

repeat = 100
Exemple #3
0
import pytest
from cloudmesh.common.util import HEADING
from cloudmesh.compute.vm.Provider import Provider
from cloudmesh.compute.libcloud.Provider import Provider
from cloudmesh.common.Benchmark import Benchmark
from cloudmesh.management.configuration.name import Name
from cloudmesh.configuration.Config import Config

Benchmark.debug()

CLOUD = "azazure"

user = Config()["cloudmesh.profile.user"]

name_generator = Name()
name_generator.set(f"test-{user}-vm-" + "{counter}")

VM = str(name_generator)


@pytest.mark.incremental
class Testazure(object):

    def setup(self):
        self.p = Provider(name=CLOUD)
        self.name = VM
        self.group = "test"
        self.location = "eastus"

    def test_login(self):
        HEADING()