def then_envFrom_contains(context, app_name, sbr_name1, sbr_name2): time.sleep(60) openshift = Openshift() result = openshift.get_deployment_envFrom_info(app_name, context.namespace.name) result | should.be_equal_to("[map[secretRef:map[name:binding-request-1]] map[secretRef:map[name:binding-request-2]]]")\ .desc(f'{app_name} deployment should contain secretRef: {sbr_name1} and {sbr_name2}')
def then_envFrom_contains(context, app_name, sbr_name): time.sleep(60) openshift = Openshift() result = openshift.get_deployment_envFrom_info(app_name, context.namespace.name) # Expected result from 'oc' (openshift client) v4.5 expected_result_oc_45 = f'secretRef:map[name:{sbr_name}]' # Expected result from 'oc' (openshift client) v4.6+ expected_result_oc_46 = f'{{"secretRef":{{"name":"{sbr_name}"}}}}' assert re.search(re.escape(expected_result_oc_45), result) is not None or re.search(re.escape(expected_result_oc_46), result) is not None, \ f'\n{app_name} deployment should contain secretRef: {sbr_name} \nActual secretRef: {result}'
def then_envFrom_contains(context, app_name): time.sleep(60) openshift = Openshift() secret = polling2.poll(lambda: get_sbr_secret_name(context), step=100, timeout=1000, ignore_exceptions=(ValueError,), check_success=lambda v: v is not None) result = openshift.get_deployment_envFrom_info(app_name, context.namespace.name) # Expected result from 'oc' (openshift client) v4.5 expected_result_oc_45 = f'secretRef:map[name:{secret}]' # Expected result from 'oc' (openshift client) v4.6+ expected_result_oc_46 = f'{{"secretRef":{{"name":"{secret}"}}}}' assert re.search(re.escape(expected_result_oc_45), result) is not None or re.search(re.escape(expected_result_oc_46), result) is not None, \ f'\n{app_name} deployment should contain secretRef: {secret} \nActual secretRef: {result}'
def then_envFrom_contains(context, app_name, sbr_name1, sbr_name2): time.sleep(60) openshift = Openshift() result = openshift.get_deployment_envFrom_info(app_name, context.namespace.name) # Expected result from 'oc' (openshift client) v4.5 expected_result_oc_45 = f'[map[secretRef:map[name:{sbr_name1}]] map[secretRef:map[name:{sbr_name2}]]]' # Expected result from 'oc' (openshift client) v4.6+ expected_result_oc_46 = f'[{{"secretRef":{{"name":"{sbr_name1}"}}}},{{"secretRef":{{"name":"{sbr_name2}"}}}}]' assert result == expected_result_oc_45 or result == expected_result_oc_46, \ f'\n{app_name} deployment should contain secretRef: {sbr_name1} and {sbr_name2}\nActual secretRef: {result}'