@@ -37,6 +37,38 @@ def test_prepare_metadata_without_alm_annotations_success(self):
3737 print (result_output )
3838 self .assertEqual (result_output ["result" ], "pass" )
3939
40+ def test_extract_operator_bundle_430_channel_success (self ):
41+ operator_work_dir = "{}/test_extract_operator_bundle_430_channel_success" .format (self .test_dir )
42+ work_dir = operator_work_dir
43+ operator_dir = "{}/test-operator" .format (operator_work_dir )
44+ operator_bundle_dir = "{}/operator-bundle" .format (operator_work_dir )
45+ bundle_image = "quay.io/cvpops/test-operator:test-430-channel-positive-v1"
46+ exec_cmd = "ansible-playbook -vvv -i localhost, --connection local \
47+ operator-test-playbooks/extract-operator-bundle.yml \
48+ -e 'operator_dir={operator_dir}' \
49+ -e 'bundle_image={bundle_image}' \
50+ -e 'operator_work_dir={operator_work_dir}' \
51+ -e 'operator_bundle_dir={operator_bundle_dir}' \
52+ -e 'work_dir={work_dir}'" .format (operator_dir = operator_dir ,
53+ operator_work_dir = operator_work_dir ,
54+ operator_bundle_dir = operator_bundle_dir ,
55+ bundle_image = bundle_image ,
56+ work_dir = work_dir )
57+ playbook_command = subprocess .run (exec_cmd , shell = True )
58+
59+ print (playbook_command .returncode )
60+ self .assertTrue (playbook_command .returncode == 0 )
61+ self .assertTrue (path .exists ("{}/parsed_operator_data.yml" .format (work_dir )))
62+ with open ("{}/parsed_operator_data.yml" .format (work_dir ), "r" ) as fd :
63+ parsed_output = fd .read ()
64+ print (parsed_output )
65+ self .assertIn ('package_name: "e2e-test-operator"' , parsed_output )
66+ self .assertIn ('current_csv: "e2e-test-operator.4.3.1-202002032140"' , parsed_output )
67+ self .assertIn ('current_channel: "4.30"' , parsed_output )
68+ self .assertIn ('is_bundle_image: True' , parsed_output )
69+ self .assertIn ('is_backport: True' , parsed_output )
70+ self .assertIn ('ocp_versions: "v4.5"' , parsed_output )
71+
4072 def test_validate_default_operator_bundle_success (self ):
4173 operator_work_dir = "{}/example-bundle-default-positive" .format (self .test_dir )
4274 work_dir = "{}/example-workdir-v45-v49" .format (self .test_dir )
0 commit comments