]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd-tests.py: add helpers to common subprocess call patterns
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Jun 2019 09:43:28 +0000 (11:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Jun 2019 12:11:28 +0000 (14:11 +0200)
commit371810d18a47319cb249c1987bbac549ae88b8e6
treef0f556561133e6a3c4239fde962ca78f7113ba3f
parent632037cf4a4a99317228c23754cd3343195af0a9
networkd-tests.py: add helpers to common subprocess call patterns

For normal shell calls, python syntax is quite verbose. We don't need to punish
ourselves like that. In some places we would fork a shell to do argument splitting
for us. We know that our arguments can be safely split on whitespace, so let's do
that ourselves in all cases, without forking a shell.

We also expect command output to be valid text, so let's always set
universal_newlines=True.

This makes things shorter and easier to read. Development is also easier because
it's possible to paste many of the commands directly to/from a shell.
test/test-network/systemd-networkd-tests.py