Revert "Updating integration tests to launch more sub proxies. Update single target tests to use a sample of 4 sub proxies for the target."

This reverts commit 8a08200d06.
This commit is contained in:
Gareth J. Greenaway 2023-04-29 17:44:57 -07:00 committed by Megan Wilhite
parent 8d21213197
commit abac2e04fa
3 changed files with 56 additions and 73 deletions

View file

@ -631,46 +631,12 @@ def io_loop():
# ----- Helpers ----------------------------------------------------------------------------------------------------->
@pytest.helpers.proxy.register
def delta_proxy_minion_ids():
number_words = {
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
8: "eight",
9: "nine",
10: "ten",
11: "eleven",
12: "twelve",
13: "thirteen",
14: "fourteen",
15: "fifteen",
16: "sixteen",
17: "seventeen",
18: "eighteen",
19: "nineteen",
20: "twenty",
21: "twenty_one",
22: "twenty_two",
23: "twenty_three",
24: "twenty_four",
25: "twenty_five",
26: "twenty_six",
27: "twenty_seven",
28: "twenty_eight",
29: "twenty_nine",
30: "thirty",
31: "thirty_one",
}
sub_proxies = []
for i in range(1, 32):
sub_proxies.append("dummy_proxy_{}".format(number_words[i]))
return sub_proxies
return [
"dummy_proxy_one",
"dummy_proxy_two",
"dummy_proxy_three",
"dummy_proxy_four",
]
# <---- Helpers ------------------------------------------------------------------------------------------------------

View file

@ -25,53 +25,71 @@ def deltaproxy_pillar_tree(request, salt_master, salt_delta_proxy_factory):
"""
Create the pillar files for controlproxy and two dummy proxy minions
"""
minion_ids = pytest.helpers.proxy.delta_proxy_minion_ids()
dummy_proxy_pillar_file = """
proxy:
proxytype: dummy"""
(
proxy_one,
proxy_two,
proxy_three,
proxy_four,
) = pytest.helpers.proxy.delta_proxy_minion_ids()
top_file = """
base:
{control}:
- controlproxy
{one}:
- {one}
{two}:
- {two}
{three}:
- {three}
{four}:
- {four}
""".format(
control=salt_delta_proxy_factory.id,
one=proxy_one,
two=proxy_two,
three=proxy_three,
four=proxy_four,
)
controlproxy_pillar_file = """
proxy:
proxytype: deltaproxy
parallel_startup: {}
ids:
- {}
- {}
- {}
- {}
""".format(
request.param,
proxy_one,
proxy_two,
proxy_three,
proxy_four,
)
top_file = """
base:
{control}:
- controlproxy""".format(
control=salt_delta_proxy_factory.id,
)
dummy_proxy_pillar_file = """
proxy:
proxytype: dummy
"""
for minion_id in minion_ids:
top_file += """
{minion_id}:
- dummy""".format(
minion_id=minion_id,
)
controlproxy_pillar_file += """
- {}
""".format(
minion_id,
)
tempfiles = []
top_tempfile = salt_master.pillar_tree.base.temp_file("top.sls", top_file)
controlproxy_tempfile = salt_master.pillar_tree.base.temp_file(
"controlproxy.sls", controlproxy_pillar_file
)
tempfiles = [top_tempfile, controlproxy_tempfile]
dummy_proxy_tempfile = salt_master.pillar_tree.base.temp_file(
"dummy.sls", dummy_proxy_pillar_file
dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file(
"{}.sls".format(proxy_one), dummy_proxy_pillar_file
)
with top_tempfile, controlproxy_tempfile, dummy_proxy_tempfile:
dummy_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file(
"{}.sls".format(proxy_two), dummy_proxy_pillar_file
)
dummy_proxy_three_tempfile = salt_master.pillar_tree.base.temp_file(
"{}.sls".format(proxy_three), dummy_proxy_pillar_file
)
dummy_proxy_four_tempfile = salt_master.pillar_tree.base.temp_file(
"{}.sls".format(proxy_four), dummy_proxy_pillar_file
)
with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, dummy_proxy_three_tempfile, dummy_proxy_four_tempfile:
yield

View file

@ -2,7 +2,6 @@
Simple Smoke Tests for Connected Proxy Minion
"""
import logging
import random
import pytest
@ -22,7 +21,7 @@ def skip_on_tcp_transport(request):
pytest.skip("Deltaproxy under the TPC transport is not working. See #61367")
@pytest.fixture(params=random.sample(pytest.helpers.proxy.delta_proxy_minion_ids(), 4))
@pytest.fixture(params=pytest.helpers.proxy.delta_proxy_minion_ids())
def proxy_id(request, salt_delta_proxy, skip_on_tcp_transport):
return request.param