diff --git a/tests/end_to_end/test_runtimes_e2e.py b/tests/end_to_end/test_runtimes_e2e.py index 23be10e392..84670913b5 100644 --- a/tests/end_to_end/test_runtimes_e2e.py +++ b/tests/end_to_end/test_runtimes_e2e.py @@ -115,6 +115,7 @@ class TestHelloWorldZipPackagePermissionsEndToEnd(EndToEndBase): app_template = "hello-world" def test_hello_world_workflow(self): + os.environ["SAM_CLI_RIE_DEV"] = "1" function_name = "HelloWorldFunction" with EndToEndTestContext(self.app_name) as e2e_context: self.template_path = e2e_context.template_path @@ -133,6 +134,7 @@ def test_hello_world_workflow(self): EndToEndBaseStage(LocalInvokeValidator(e2e_context), e2e_context, local_command_list), ] self._run_tests(stages) + os.environ.pop("SAM_CLI_RIE_DEV", None) @skipIf(SKIP_E2E_TESTS, "Skip E2E tests in CI/CD only") diff --git a/tests/end_to_end/test_stages.py b/tests/end_to_end/test_stages.py index f405606331..c24af1826a 100644 --- a/tests/end_to_end/test_stages.py +++ b/tests/end_to_end/test_stages.py @@ -2,6 +2,7 @@ from unittest import TestCase +import logging import boto3 import zipfile import json @@ -16,6 +17,8 @@ from tests.end_to_end.end_to_end_context import EndToEndTestContext from tests.testing_utils import CommandResult, run_command, run_command_with_input +LOG = logging.getLogger(__name__) + class BaseValidator(TestCase): def __init__(self, test_context: EndToEndTestContext): @@ -109,6 +112,12 @@ def _download_packaged_file(self): with zipfile.ZipFile(zip_file_path, "r") as zip_refzip: zip_refzip.extractall(path=built_function_path) + file_list = zip_refzip.namelist() + + for extracted_file in file_list: + permission_mask = oct(os.stat(os.path.join(built_function_path, extracted_file)).st_mode)[-3:] + LOG.info("Extracted file %s, with permission mask %s", extracted_file, permission_mask) + class DefaultSyncStage(EndToEndBaseStage): def run_stage(self) -> CommandResult: