diff options
author | Thomas Haller <thaller@redhat.com> | 2023-03-30 14:55:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-03-30 15:06:54 +0200 |
commit | a9558231cf8cdf5826829bc77a93b914b0d1fd79 (patch) | |
tree | c7e475916fad5d84645df3a63fe8daa19875eeb6 | |
parent | 15c25e91f5a59d284ef99053bcb695c9843c5e31 (diff) | |
download | NetworkManager-a9558231cf8cdf5826829bc77a93b914b0d1fd79.tar.gz |
client/tests: drop unnecessary socket.set_inheritable() call from "test-client.py"
This seems unnecessary, because we spawn the child process via subprocess.Popen and
set "pass_fds". That already ensures to pass on the FD.
Worse, socket.set_inheritable() is only added in Python 3.4, that means the
test is gonna break for Python 3.2 and 3.3. Just avoid that by not using the
unnecessary function. For the same reason, drop "inheritable=True" from
os.dup2(). "inheritable=True" is already the default, but only exists
since Python 3.4.
Fixes: d89d42bf2317 ('tests/client: test nm-cloud-setup')
-rwxr-xr-x | src/tests/client/test-client.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index 31cfbb0e1e..84450e2ad3 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -2151,7 +2151,6 @@ class TestNmCloudSetup(TestNmClient): raise unittest.SkipTest("This test requires at least Python 3.2") s = socket.socket() - s.set_inheritable(True) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) s.bind(("localhost", 0)) @@ -2162,7 +2161,7 @@ class TestNmCloudSetup(TestNmClient): s.listen(5) def pass_socket(): - os.dup2(s.fileno(), 3, inheritable=True) + os.dup2(s.fileno(), 3) service_path = PathConfiguration.test_cloud_meta_mock_path() env = os.environ.copy() |