Skip to content

Commit

Permalink
Merge pull request rancher#44082 from anupama2501/customhostchange27
Browse files Browse the repository at this point in the history
[2.7 Backport]Adding repository and image as a param
  • Loading branch information
anupama2501 authored Feb 9, 2024
2 parents b6f6fcb + e6a6c87 commit 43f864a
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions tests/validation/tests/v3_api/test_custom_host_reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
RANCHER_ELASTIC_SEARCH_ENDPOINT = os.environ.get(
'RANCHER_ELASTIC_SEARCH_ENDPOINT', "")
K8S_VERSION = os.environ.get('RANCHER_K8S_VERSION', "")
RANCHER_REPOSITORY_IMAGE = os.environ.get('RANCHER_REPOSITORY_IMAGE', "rancher/rancher")


def test_add_custom_host():
Expand All @@ -44,21 +45,13 @@ def test_delete_keypair():


def test_deploy_rancher_server():
if "v2.5" in RANCHER_SERVER_VERSION or \
"master" in RANCHER_SERVER_VERSION or \
"v2.6" in RANCHER_SERVER_VERSION or \
"v2.7" in RANCHER_SERVER_VERSION:
RANCHER_SERVER_CMD = \
'sudo docker run -d --privileged --name="rancher-server" ' \
'--restart=unless-stopped -p 80:80 -p 443:443 ' \
'-e CATTLE_BOOTSTRAP_PASSWORD="{}" ' \
'rancher/rancher'.format(ADMIN_PASSWORD)
else:
RANCHER_SERVER_CMD = \
'sudo docker run -d --name="rancher-server" ' \
'--restart=unless-stopped -p 80:80 -p 443:443 ' \
'rancher/rancher'
RANCHER_SERVER_CMD += ":" + RANCHER_SERVER_VERSION + " --trace"

RANCHER_SERVER_CMD = \
'sudo docker run -d --privileged --name="rancher-server" ' \
'--restart=unless-stopped -p 80:80 -p 443:443 ' \
'-e CATTLE_BOOTSTRAP_PASSWORD="{}" ' \
'{}:{} --trace'.format(ADMIN_PASSWORD,RANCHER_REPOSITORY_IMAGE,RANCHER_SERVER_VERSION)

print(RANCHER_SERVER_CMD)
aws_nodes = AmazonWebServices().create_multiple_nodes(
1, random_test_name("testsa" + HOST_NAME))
Expand Down

0 comments on commit 43f864a

Please sign in to comment.