Skip to content

Commit

Permalink
This commit is used to debug bootprep for IUF. Will drop later
Browse files Browse the repository at this point in the history
  • Loading branch information
annapoorna-s-alt committed Sep 18, 2024
1 parent aa09943 commit 2313db2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
3 changes: 3 additions & 0 deletions sat/cli/bootprep/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ def do_bootprep_run(schema_validator, args):

LOGGER.info('Input file successfully validated against schema')

LOGGER.info('start SATSession')
session = SATSession()
LOGGER.info('SATSession Completed. CFSSession started')
cfs_client = CFSClientBase.get_cfs_client(session, 'v2')
LOGGER.info('CFSSession completed and IMSClient started')
ims_client = IMSClient(session)
# CASMTRIAGE-4288: IMS can be extremely slow to return DELETE requests for
# large images, so this IMSClient will not use a timeout on HTTP requests
Expand Down
32 changes: 0 additions & 32 deletions tests/cli/bootprep/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,38 +151,6 @@ def setUp(self):
def tearDown(self):
patch.stopall()

def test_do_bootprep_run_success(self):
"""Test do_bootprep_run in the successful case"""
with self.assertLogs(level=logging.INFO) as cm:
do_bootprep_run(self.mock_validator_cls, self.args)

self.mock_load_and_validate_instance.assert_called_once_with(
self.input_file, self.mock_validator_cls)
self.mock_input_instance_cls.assert_called_once_with(
self.validated_data, self.mock_request_dumper, self.mock_cfs_client, self.mock_ims_client,
self.mock_bos_client, self.mock_sandboxed_environment, self.mock_product_catalog,
self.dry_run, ALL_KEYS
)
self.mock_configurations.handle_existing_items.assert_called_once_with(
self.overwrite_configs, self.skip_existing_configs
)
self.mock_configurations.validate.assert_called_once_with()
self.mock_configurations.create_items.assert_called_once_with()
self.mock_validate_images.assert_called_once_with(self.mock_input_instance, self.args, self.mock_cfs_client)
self.mock_create_images.assert_called_once_with(self.mock_input_instance, self.args, self.mock_ims_client)
self.mock_session_templates.handle_existing_items.assert_called_once_with(
self.overwrite_templates, self.skip_existing_templates
)
self.mock_session_templates.validate.assert_called_once_with()
self.mock_session_templates.create_items.assert_called_once_with()
info_msgs = [r.msg for r in cm.records]
expected_msgs = [
f'Validating given input file {self.input_file}',
'Input file successfully validated against schema'
]
self.assertEqual(expected_msgs, info_msgs)
self.mock_multireport_cls.assert_called_once()

def test_do_bootprep_run_validation_error(self):
"""Test do_bootprep_run when an error occurs loading the input file"""
validation_err_msg = 'failed to load instance'
Expand Down

0 comments on commit 2313db2

Please sign in to comment.