3896
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3895
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3894
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3893
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3892
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3891
|
|
fix(tests): Clear environment for test_run_as_real_user_no_sudo
The test `test_run_as_real_user_no_sudo` can fail if the environment has `SUDO_UID` set and is run as root:
``` ====================================================================== FAIL: test_run_as_real_user_no_sudo (tests.integration.test_ui.T.test_run_as_real_user_no_sudo) Test run_as_real_user() without sudo env variables. ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.11/unittest/mock.py", line 1369, in patched return func(*newargs, **newkeywargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/unittest/mock.py", line 1822, in _inner return f(*args, **kw) ^^^^^^^^^^^^^^ File "/tmp/autopkgtest.Z6SSWK/autopkgtest_tmp/tests/integration/test_ui.py", line 2779, in test_run_as_real_user_no_sudo run_mock.assert_called_once_with(["/bin/true"], check=False) File "/usr/lib/python3.11/unittest/mock.py", line 945, in assert_called_once_with return self.assert_called_with(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/unittest/mock.py", line 933, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: expected call not found. Expected: run(['/bin/true'], check=False) Actual: run(['/bin/true'], check=False, env={'SHELL': '/bin/bash', 'no_proxy': '127.0.0.1,127.0.1.1,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,launchpad.net,10.24.0.0/24', 'AUTOPKGTEST_NORMAL_USER': 'ubuntu', 'AUTOPKGTEST_TMP': '/tmp/autopkgtest.Z6SSWK/autopkgtest_tmp', 'PWD': '/tmp/autopkgtest.Z6SSWK/autopkgtest_tmp', 'ADT_TEST_TRIGGERS': 'apport/2.26.1-0ubuntu1', 'LOGNAME': 'root', 'HOME': '/home/ubuntu', 'ADTTMP': '/tmp/autopkgtest.Z6SSWK/autopkgtest_tmp', 'https_proxy': 'http://squid.internal:3128', 'AUTOPKGTEST_ARTIFACTS': '/tmp/autopkgtest.Z6SSWK/unit-and-integration-tests-artifacts', 'TERM': 'linux', 'USER': 'root', 'DEB_BUILD_OPTIONS': 'parallel=1', 'SHLVL': '2', 'ADT_NORMAL_USER': 'ubuntu', 'http_proxy': 'http://squid.internal:3128', 'DEBUGINFOD_URLS': 'https://debuginfod.ubuntu.com ', 'ADT_ARTIFACTS': '/tmp/autopkgtest.Z6SSWK/unit-and-integration-tests-artifacts', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'MAIL': '/var/mail/root', 'DEBIAN_FRONTEND': 'noninteractive', 'OLDPWD': '/tmp/autopkgtest.Z6SSWK/build.jCs/src', '_': '/usr/bin/python3', 'APPORT_CRASHDB_CONF': '/tmp/tmpri_h0dcw', 'APPORT_IGNORE_OBSOLETE_PACKAGES': '1', 'APPORT_DISABLE_DISTRO_CHECK': '1'}, user=1000, group=1000, extra_groups=[1000, 4, 20, 24, 25, 27, 29, 30, 44, 46, 118, 119]) ```
Clear the mocked environment to be empty to ensure `SUDO_UID` is not set.
|
Benjamin Drung |
|
1 year ago
|
|
|
3890
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3889
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3888
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3887
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3886
|
|
fix(apport-unpack): Catch MalformedProblemReport on extraction
Commit b06d44fb61e51dd637cab89452b7c6b632c7e243 catches `binascii.Error` and raise a `MalformedProblemReport` exception instead, but `apport-unpack` does not catch `MalformedProblemReport` on extracting the keys:
``` $ printf "CoreDump: base64\n H4sICAAAAAAC/0NvcmVEdW1wAA==\n 7Z0LYFPV/cdP0rQ\n" > malformed.crash $ apport-unpack malformed.crash unpack Traceback (most recent call last): File "/usr/bin/apport-unpack", line 91, in <module> main() File "/usr/bin/apport-unpack", line 85, in main pr.extract_keys(f, bin_keys, args.target_directory) File "/usr/lib/python3/dist-packages/problem_report.py", line 254, in extract_keys bd, line_value = self._decompress_line( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/problem_report.py", line 316, in _decompress_line raise MalformedProblemReport(str(error)) from None problem_report.MalformedProblemReport: Malformed problem report: Incorrect padding. Is this a proper .crash text file? ```
Bug: https://launchpad.net/bugs/1997912 Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
|
Benjamin Drung |
|
1 year ago
|
|
|
3885
|
|
|
Benjamin Drung |
2.26.1 |
1 year ago
|
|
|
3884
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3883
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3882
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3881
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3880
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3879
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3878
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|
3877
|
|
|
Benjamin Drung |
|
1 year ago
|
|
|