Merge pull request #54172 from Ch3LL/azurearm_tests

Migrate from azure to azurearm tests
This commit is contained in:
Daniel Wozniak 2019-08-13 13:07:33 -07:00 committed by GitHub
commit a13cb3eae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 29 deletions

View file

@ -20,7 +20,7 @@ from salt.config import cloud_providers_config
from salt.utils.versions import LooseVersion
from salt.ext.six.moves import range
TIMEOUT = 500
TIMEOUT = 1000
try:
import azure # pylint: disable=unused-import
@ -33,7 +33,7 @@ if HAS_AZURE and not hasattr(azure, '__version__'):
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = generate_random_name('CLOUD-TEST-')
PROVIDER_NAME = 'azure'
PROVIDER_NAME = 'azurearm'
PROFILE_NAME = 'azure-test'
REQUIRED_AZURE = '0.11.1'
@ -89,8 +89,7 @@ class AzureTest(ShellCase):
)
)
sub_id = provider_config[provider_str][PROVIDER_NAME]['subscription_id']
cert_path = provider_config[provider_str][PROVIDER_NAME]['certificate_path']
if sub_id == '' or cert_path == '':
if sub_id == '':
self.skipTest(
'A subscription_id and certificate_path must be provided to run '
'these tests. Check '
@ -99,21 +98,6 @@ class AzureTest(ShellCase):
)
)
# check if ssh_username, ssh_password, and media_link are present
# in the azure configuration file
ssh_user = provider_config[provider_str][PROVIDER_NAME]['ssh_username']
ssh_pass = provider_config[provider_str][PROVIDER_NAME]['ssh_password']
media_link = provider_config[provider_str][PROVIDER_NAME]['media_link']
if ssh_user == '' or ssh_pass == '' or media_link == '':
self.skipTest(
'An ssh_username, ssh_password, and media_link must be provided to run '
'these tests. One or more of these elements is missing. Check '
'tests/integration/files/conf/cloud.profiles.d/{0}.conf'.format(
PROVIDER_NAME
)
)
def test_instance(self):
'''
Test creating an instance on Azure

View file

@ -1,10 +1,8 @@
azure-test:
provider: azure-config
image: 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB'
size: Medium
location: West US
size: Standard_D1
slot: production
ssh_username: ''
ssh_password: ''
media_link: ''
script_args: '-P'

View file

@ -1,7 +0,0 @@
azure-config:
driver: azure
subscription_id: ''
certificate_path: ''
cleanup_disks: True
cleanup_vhds: True
cleanup_services: True

View file

@ -0,0 +1,16 @@
azure-config:
driver: azurearm
subscription_id: ''
cleanup_disks: True
cleanup_interfaces: True
cleanup_vhds: True
cleanup_services: True
minion:
master_type: str
username: ''
password: ''
location: ''
network_resource_group: ''
network: ''
subnet: ''
resource_group: ''