Skip to content

Commit c8dd7ca

Browse files
committed
Fixes
1 parent 3692862 commit c8dd7ca

3 files changed

Lines changed: 31 additions & 23 deletions

File tree

.secrets.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2026-05-21T00:44:44Z",
6+
"generated_at": "2026-05-21T00:57:00Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -178,15 +178,15 @@
178178
"hashed_secret": "94f5ed592906089c107208b29e178ddf1f9f5143",
179179
"is_secret": false,
180180
"is_verified": false,
181-
"line_number": 38,
181+
"line_number": 42,
182182
"type": "Secret Keyword",
183183
"verified_result": null
184184
},
185185
{
186186
"hashed_secret": "a9410d9785f49750b9f8672794fc288558c1611c",
187187
"is_secret": false,
188188
"is_verified": false,
189-
"line_number": 51,
189+
"line_number": 55,
190190
"type": "Secret Keyword",
191191
"verified_result": null
192192
}

test/src/test_mas.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818

1919
pytestmark = pytest.mark.openshift
2020

21-
dynClient = dynamic.DynamicClient(
22-
api_client.ApiClient(configuration=config.load_kube_config())
23-
)
2421

22+
@pytest.fixture(scope="module")
23+
def dynClient():
24+
"""Create DynamicClient for OpenShift cluster access."""
25+
return dynamic.DynamicClient(
26+
api_client.ApiClient(configuration=config.load_kube_config())
27+
)
2528

26-
def test_entitlement():
29+
30+
def test_entitlement(dynClient):
2731
icrUsername = "testing-i"
2832
icrPassword = "not-a-real-password-i"
2933

@@ -33,7 +37,7 @@ def test_entitlement():
3337
assert secret.metadata.name == "ibm-entitlement"
3438

3539

36-
def test_entitlement_with_artifactory():
40+
def test_entitlement_with_artifactory(dynClient):
3741
artifactoryUsername = "testing-a"
3842
artifactoryPassword = "not-a-real-password-a"
3943

@@ -46,7 +50,7 @@ def test_entitlement_with_artifactory():
4650
assert secret.metadata.name == "ibm-entitlement"
4751

4852

49-
def test_entitlement_alt_name():
53+
def test_entitlement_alt_name(dynClient):
5054
icrUsername = "testing-i"
5155
icrPassword = "not-a-real-password-i"
5256

@@ -56,23 +60,23 @@ def test_entitlement_alt_name():
5660
assert secret.metadata.name == "ibm-entitlement-key"
5761

5862

59-
def test_get_channel():
63+
def test_get_channel(dynClient):
6064
channel = mas.getMasChannel(dynClient, "doesnotexist")
6165
assert channel is None
6266

6367

64-
def test_is_airgap_install():
68+
def test_is_airgap_install(dynClient):
6569
# The cluster we are using to test with does not have the MAS ICSP or IDMS installed
6670
assert mas.isAirgapInstall(dynClient) is False
6771
assert mas.isAirgapInstall(dynClient, checkICSP=False) is False
6872

6973

70-
def test_get_mas_public_cluster_issuer():
74+
def test_get_mas_public_cluster_issuer(dynClient):
7175
# Test with non-existent instance - should return None
7276
issuer = mas.getMasPublicClusterIssuer(dynClient, "doesnotexist")
7377
assert issuer is None
7478

7579

76-
# def test_is_app_ready():
80+
# def test_is_app_ready(dynClient):
7781
# mas.waitForAppReady(dynClient, "fvtcpd", "iot")
7882
# mas.waitForAppReady(dynClient, "fvtcpd", "iot", "masdev")

test/src/test_olm.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717

1818
pytestmark = pytest.mark.openshift
1919

20-
dynClient = dynamic.DynamicClient(
21-
api_client.ApiClient(configuration=config.load_kube_config())
22-
)
20+
21+
@pytest.fixture(scope="module")
22+
def dynClient():
23+
"""Create DynamicClient for OpenShift cluster access."""
24+
return dynamic.DynamicClient(
25+
api_client.ApiClient(configuration=config.load_kube_config())
26+
)
2327

2428

25-
def test_get_manifest():
29+
def test_get_manifest(dynClient):
2630
manifest = olm.getPackageManifest(dynClient, "ibm-sls")
2731
assert manifest is not None
2832
assert manifest.metadata.name == "ibm-sls"
@@ -33,12 +37,12 @@ def test_get_manifest():
3337
assert manifest.status.packageName == "ibm-sls"
3438

3539

36-
def test_get_manifest_none():
40+
def test_get_manifest_none(dynClient):
3741
manifest = olm.getPackageManifest(dynClient, "ibm-sls2")
3842
assert manifest is None
3943

4044

41-
def test_crud():
45+
def test_crud(dynClient):
4246
namespace = "cli-fvt-1"
4347
subscription = olm.applySubscription(dynClient, namespace, "ibm-sls", packageChannel="3.x")
4448
assert subscription.metadata.name == "ibm-sls"
@@ -65,7 +69,7 @@ def test_crud():
6569
assert failedSubscriptionLookup2 is None
6670

6771

68-
def test_crud_with_config():
72+
def test_crud_with_config(dynClient):
6973
namespace = "cli-fvt-2"
7074
# We don't need this, just want to test that it works
7175
testConfig = {
@@ -84,7 +88,7 @@ def test_crud_with_config():
8488
ocp.deleteNamespace(dynClient, namespace)
8589

8690

87-
def test_crud_with_manual_approval():
91+
def test_crud_with_manual_approval(dynClient):
8892
"""
8993
Test that when installPlanApproval is Manual without a startingCSV,
9094
an OLMException is raised.
@@ -108,7 +112,7 @@ def test_crud_with_manual_approval():
108112
# Test passed - exception was raised as expected
109113

110114

111-
def test_crud_with_starting_csv():
115+
def test_crud_with_starting_csv(dynClient):
112116
namespace = "cli-fvt-4"
113117
# Note: This test assumes a specific CSV version exists in the catalog
114118
# You may need to adjust the version based on what's available
@@ -130,7 +134,7 @@ def test_crud_with_starting_csv():
130134
ocp.deleteNamespace(dynClient, namespace)
131135

132136

133-
def test_crud_with_manual_approval_and_starting_csv():
137+
def test_crud_with_manual_approval_and_starting_csv(dynClient):
134138
"""
135139
Test that when installPlanApproval is Manual and startingCSV is specified,
136140
the first InstallPlan is automatically approved to reach the startingCSV.

0 commit comments

Comments
 (0)