зеркало из https://github.com/Azure/Avere.git
Code cleanup (in progress)
This commit is contained in:
Родитель
2bda826793
Коммит
288dc5332e
|
@ -28,7 +28,7 @@ jobs:
|
||||||
displayName: 'Install Python dependencies'
|
displayName: 'Install Python dependencies'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
pytest test/test_avere_template_deploy.py --doctest-modules --junitxml=junit/test-results01.xml
|
pytest --disable-pytest-warnings test/test_avere_template_deploy.py --doctest-modules --junitxml=junit/test-results01.xml
|
||||||
displayName: 'Test template-based deployment of Avere vFXT'
|
displayName: 'Test template-based deployment of Avere vFXT'
|
||||||
env:
|
env:
|
||||||
AVERE_ADMIN_PW: $(controllerpassword)
|
AVERE_ADMIN_PW: $(controllerpassword)
|
||||||
|
@ -40,7 +40,7 @@ jobs:
|
||||||
VFXT_TEST_VARS_FILE: pipelines.json
|
VFXT_TEST_VARS_FILE: pipelines.json
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
pytest test/test_vfxt_cluster_status.py -k TestVfxtClusterStatus --doctest-modules --junitxml=junit/test-results02.xml
|
pytest --disable-pytest-warnings test/test_vfxt_cluster_status.py -k TestVfxtClusterStatus --doctest-modules --junitxml=junit/test-results02.xml
|
||||||
displayName: 'Test cluster status, health, etc.'
|
displayName: 'Test cluster status, health, etc.'
|
||||||
condition: succeeded()
|
condition: succeeded()
|
||||||
env:
|
env:
|
||||||
|
@ -53,7 +53,7 @@ jobs:
|
||||||
VFXT_TEST_VARS_FILE: pipelines.json
|
VFXT_TEST_VARS_FILE: pipelines.json
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
pytest test/test_vfxt_cluster_status.py -k TestVfxtSupport --doctest-modules --junitxml=junit/test-results03.xml
|
pytest --disable-pytest-warnings test/test_vfxt_cluster_status.py -k TestVfxtSupport --doctest-modules --junitxml=junit/test-results03.xml
|
||||||
|
|
||||||
CONTROLLER_IP=$(grep controller_ip $VFXT_TEST_VARS_FILE | sed -E 's/^.*controller_ip": "([^"]+)".*$/\1/')
|
CONTROLLER_IP=$(grep controller_ip $VFXT_TEST_VARS_FILE | sed -E 's/^.*controller_ip": "([^"]+)".*$/\1/')
|
||||||
CONTROLLER_NAME=$(grep controller_name $VFXT_TEST_VARS_FILE | sed -E 's/^.*controller_name": "([^"]+)".*$/\1/')
|
CONTROLLER_NAME=$(grep controller_name $VFXT_TEST_VARS_FILE | sed -E 's/^.*controller_name": "([^"]+)".*$/\1/')
|
||||||
|
@ -90,7 +90,7 @@ jobs:
|
||||||
VFXT_TEST_VARS_FILE: pipelines.json
|
VFXT_TEST_VARS_FILE: pipelines.json
|
||||||
|
|
||||||
# - script: |
|
# - script: |
|
||||||
# pytest test/test_vdbench.py --doctest-modules --junitxml=junit/test-results04.xml
|
# pytest --disable-pytest-warnings test/test_vdbench.py --doctest-modules --junitxml=junit/test-results04.xml
|
||||||
# displayName: 'Test vdbench on Avere vFXT'
|
# displayName: 'Test vdbench on Avere vFXT'
|
||||||
# env:
|
# env:
|
||||||
# AZURE_TENANT_ID: $(SPTENANTID)
|
# AZURE_TENANT_ID: $(SPTENANTID)
|
||||||
|
@ -100,7 +100,7 @@ jobs:
|
||||||
# VFXT_TEST_VARS_FILE: pipelines.json
|
# VFXT_TEST_VARS_FILE: pipelines.json
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
pytest test/test_edasim.py --doctest-modules --junitxml=junit/test-results05.xml
|
pytest --disable-pytest-warnings test/test_edasim.py --doctest-modules --junitxml=junit/test-results05.xml
|
||||||
displayName: 'Test edasim on Avere vFXT'
|
displayName: 'Test edasim on Avere vFXT'
|
||||||
env:
|
env:
|
||||||
AZURE_TENANT_ID: $(SPTENANTID)
|
AZURE_TENANT_ID: $(SPTENANTID)
|
||||||
|
|
|
@ -15,7 +15,6 @@ import pytest
|
||||||
|
|
||||||
# local libraries
|
# local libraries
|
||||||
from lib.helpers import split_ip_range, wait_for_op
|
from lib.helpers import split_ip_range, wait_for_op
|
||||||
from lib.pytest_fixtures import resource_group, test_vars # noqa: F401
|
|
||||||
|
|
||||||
|
|
||||||
class TestVfxtTemplateDeploy:
|
class TestVfxtTemplateDeploy:
|
||||||
|
|
|
@ -15,9 +15,7 @@ import pytest
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
# local libraries
|
# local libraries
|
||||||
from lib import helpers
|
from lib.helpers import run_ssh_commands, wait_for_op
|
||||||
from lib.pytest_fixtures import (mnt_nodes, resource_group, # noqa: F401
|
|
||||||
scp_cli, ssh_con, storage_account, test_vars)
|
|
||||||
|
|
||||||
|
|
||||||
class TestEdasim:
|
class TestEdasim:
|
||||||
|
@ -29,7 +27,7 @@ class TestEdasim:
|
||||||
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.profile
|
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.profile
|
||||||
source ~/.profile && cd $GOPATH && go get -v github.com/Azure/Avere/src/go/...
|
source ~/.profile && cd $GOPATH && go get -v github.com/Azure/Avere/src/go/...
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
helpers.run_ssh_commands(ssh_con, commands)
|
run_ssh_commands(ssh_con, commands)
|
||||||
|
|
||||||
def test_storage_account(self, resource_group, ssh_con, storage_account, test_vars): # noqa: F811, E501
|
def test_storage_account(self, resource_group, ssh_con, storage_account, test_vars): # noqa: F811, E501
|
||||||
log = logging.getLogger("test_storage_account")
|
log = logging.getLogger("test_storage_account")
|
||||||
|
@ -45,7 +43,7 @@ class TestEdasim:
|
||||||
export AZURE_STORAGE_ACCOUNT= {0}
|
export AZURE_STORAGE_ACCOUNT= {0}
|
||||||
export AZURE_STORAGE_ACCOUNT_KEY={1}
|
export AZURE_STORAGE_ACCOUNT_KEY={1}
|
||||||
""".format(storage_account.name, key).split("\n")
|
""".format(storage_account.name, key).split("\n")
|
||||||
helpers.run_ssh_commands(ssh_con, commands)
|
run_ssh_commands(ssh_con, commands)
|
||||||
test_vars["cmd1"] = "AZURE_STORAGE_ACCOUNT=\"{}\" AZURE_STORAGE_ACCOUNT_KEY=\"{}\" ".format(storage_account.name, key)
|
test_vars["cmd1"] = "AZURE_STORAGE_ACCOUNT=\"{}\" AZURE_STORAGE_ACCOUNT_KEY=\"{}\" ".format(storage_account.name, key)
|
||||||
|
|
||||||
def test_event_hub(self, ssh_con, test_vars): # noqa: F811
|
def test_event_hub(self, ssh_con, test_vars): # noqa: F811
|
||||||
|
@ -64,7 +62,7 @@ class TestEdasim:
|
||||||
atd.deploy_name = "test_event_hub"
|
atd.deploy_name = "test_event_hub"
|
||||||
log.debug('Generated deploy parameters: \n{}'.format(
|
log.debug('Generated deploy parameters: \n{}'.format(
|
||||||
json.dumps(atd.deploy_params, indent=4)))
|
json.dumps(atd.deploy_params, indent=4)))
|
||||||
deploy_result = helpers.wait_for_op(atd.deploy())
|
deploy_result = wait_for_op(atd.deploy())
|
||||||
test_vars["deploy_eh_outputs"] = deploy_result.properties.outputs
|
test_vars["deploy_eh_outputs"] = deploy_result.properties.outputs
|
||||||
log.debug(test_vars["deploy_eh_outputs"])
|
log.debug(test_vars["deploy_eh_outputs"])
|
||||||
policy_primary_key = test_vars["deploy_eh_outputs"]["eventHubSharedAccessPolicyPrimaryKey"]["value"]
|
policy_primary_key = test_vars["deploy_eh_outputs"]["eventHubSharedAccessPolicyPrimaryKey"]["value"]
|
||||||
|
@ -74,7 +72,7 @@ class TestEdasim:
|
||||||
export AZURE_EVENTHUB_SENDERKEY={0}
|
export AZURE_EVENTHUB_SENDERKEY={0}
|
||||||
export AZURE_EVENTHUB_NAMESPACENAME="edasimeventhub2"
|
export AZURE_EVENTHUB_NAMESPACENAME="edasimeventhub2"
|
||||||
""".format(policy_primary_key).split("\n")
|
""".format(policy_primary_key).split("\n")
|
||||||
helpers.run_ssh_commands(ssh_con, commands)
|
run_ssh_commands(ssh_con, commands)
|
||||||
test_vars["cmd2"] = "AZURE_EVENTHUB_SENDERKEYNAME=\"RootManageSharedAccessKey\" AZURE_EVENTHUB_SENDERKEY=\"{}\" AZURE_EVENTHUB_NAMESPACENAME=\"edasimeventhub2\"".format(policy_primary_key)
|
test_vars["cmd2"] = "AZURE_EVENTHUB_SENDERKEYNAME=\"RootManageSharedAccessKey\" AZURE_EVENTHUB_SENDERKEY=\"{}\" AZURE_EVENTHUB_NAMESPACENAME=\"edasimeventhub2\"".format(policy_primary_key)
|
||||||
|
|
||||||
def test_edasim_setup(self, mnt_nodes, ssh_con): # noqa: F811
|
def test_edasim_setup(self, mnt_nodes, ssh_con): # noqa: F811
|
||||||
|
@ -100,7 +98,7 @@ class TestEdasim:
|
||||||
sudo curl --retry 5 --retry-delay 5 -o orchestrator.service https://raw.githubusercontent.com/Azure/Avere/master/src/go/cmd/edasim/deploymentartifacts/bootstrap/systemd/orchestrator.service
|
sudo curl --retry 5 --retry-delay 5 -o orchestrator.service https://raw.githubusercontent.com/Azure/Avere/master/src/go/cmd/edasim/deploymentartifacts/bootstrap/systemd/orchestrator.service
|
||||||
sudo curl --retry 5 --retry-delay 5 -o worker.service https://raw.githubusercontent.com/Azure/Avere/master/src/go/cmd/edasim/deploymentartifacts/bootstrap/systemd/worker.service
|
sudo curl --retry 5 --retry-delay 5 -o worker.service https://raw.githubusercontent.com/Azure/Avere/master/src/go/cmd/edasim/deploymentartifacts/bootstrap/systemd/worker.service
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
helpers.run_ssh_commands(ssh_con, commands)
|
run_ssh_commands(ssh_con, commands)
|
||||||
|
|
||||||
def test_edasim_deploy(self, test_vars): # noqa: F811
|
def test_edasim_deploy(self, test_vars): # noqa: F811
|
||||||
atd = test_vars["atd_obj"]
|
atd = test_vars["atd_obj"]
|
||||||
|
@ -120,7 +118,7 @@ class TestEdasim:
|
||||||
"nfsExportPath": "/msazure",
|
"nfsExportPath": "/msazure",
|
||||||
}
|
}
|
||||||
atd.deploy_name = "test_edasim_deploy"
|
atd.deploy_name = "test_edasim_deploy"
|
||||||
deploy_result = helpers.wait_for_op(atd.deploy())
|
deploy_result = wait_for_op(atd.deploy())
|
||||||
test_vars["deploy_edasim_outputs"] = deploy_result.properties.outputs
|
test_vars["deploy_edasim_outputs"] = deploy_result.properties.outputs
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,7 @@ from scp import SCPClient
|
||||||
from sshtunnel import SSHTunnelForwarder
|
from sshtunnel import SSHTunnelForwarder
|
||||||
|
|
||||||
# local libraries
|
# local libraries
|
||||||
from lib import helpers
|
from lib.helpers import create_ssh_client, run_ssh_commands, wait_for_op
|
||||||
from lib.pytest_fixtures import (mnt_nodes, ssh_con, test_vars) # noqa: F401
|
|
||||||
|
|
||||||
|
|
||||||
class TestVDBench:
|
class TestVDBench:
|
||||||
|
@ -33,7 +32,7 @@ class TestVDBench:
|
||||||
sudo chmod +x /nfs/node0/bootstrap/vdbenchVerify.sh
|
sudo chmod +x /nfs/node0/bootstrap/vdbenchVerify.sh
|
||||||
/nfs/node0/bootstrap/vdbenchVerify.sh
|
/nfs/node0/bootstrap/vdbenchVerify.sh
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
helpers.run_ssh_commands(ssh_con, commands)
|
run_ssh_commands(ssh_con, commands)
|
||||||
|
|
||||||
def test_vdbench_deploy(self, test_vars): # noqa: F811
|
def test_vdbench_deploy(self, test_vars): # noqa: F811
|
||||||
log = logging.getLogger("test_vdbench_deploy")
|
log = logging.getLogger("test_vdbench_deploy")
|
||||||
|
@ -56,7 +55,7 @@ class TestVDBench:
|
||||||
"bootstrapScriptPath": "/bootstrap/bootstrap.vdbench.sh",
|
"bootstrapScriptPath": "/bootstrap/bootstrap.vdbench.sh",
|
||||||
}
|
}
|
||||||
atd.deploy_name = "test_vdbench"
|
atd.deploy_name = "test_vdbench"
|
||||||
deploy_result = helpers.wait_for_op(atd.deploy())
|
deploy_result = wait_for_op(atd.deploy())
|
||||||
test_vars["deploy_vd_outputs"] = deploy_result.properties.outputs
|
test_vars["deploy_vd_outputs"] = deploy_result.properties.outputs
|
||||||
|
|
||||||
def test_vdbench_run(self, test_vars): # noqa: F811
|
def test_vdbench_run(self, test_vars): # noqa: F811
|
||||||
|
@ -70,7 +69,7 @@ class TestVDBench:
|
||||||
) as ssh_tunnel:
|
) as ssh_tunnel:
|
||||||
sleep(1)
|
sleep(1)
|
||||||
try:
|
try:
|
||||||
ssh_client = helpers.create_ssh_client(
|
ssh_client = create_ssh_client(
|
||||||
test_vars["controller_user"],
|
test_vars["controller_user"],
|
||||||
"127.0.0.1",
|
"127.0.0.1",
|
||||||
ssh_tunnel.local_bind_port,
|
ssh_tunnel.local_bind_port,
|
||||||
|
@ -86,7 +85,7 @@ class TestVDBench:
|
||||||
cd
|
cd
|
||||||
./run_vdbench.sh inmem.conf uniquestring1
|
./run_vdbench.sh inmem.conf uniquestring1
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
helpers.run_ssh_commands(ssh_client, commands)
|
run_ssh_commands(ssh_client, commands)
|
||||||
finally:
|
finally:
|
||||||
ssh_client.close()
|
ssh_client.close()
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@ from sshtunnel import SSHTunnelForwarder
|
||||||
# local libraries
|
# local libraries
|
||||||
from lib.helpers import (create_ssh_client, run_averecmd, run_ssh_commands,
|
from lib.helpers import (create_ssh_client, run_averecmd, run_ssh_commands,
|
||||||
upload_gsi)
|
upload_gsi)
|
||||||
from lib.pytest_fixtures import (averecmd_params, mnt_nodes, # noqa: F401
|
|
||||||
resource_group, scp_cli, ssh_con, test_vars)
|
|
||||||
|
|
||||||
|
|
||||||
class TestVfxtClusterStatus:
|
class TestVfxtClusterStatus:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче