]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: use timedatectl in build directory
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 15 Jul 2022 00:47:41 +0000 (09:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Aug 2022 10:37:49 +0000 (19:37 +0900)
test/test-network/systemd-networkd-tests.py

index 9266441944cb30537005b1073ae9dcd737e9aaa4..0ead5c8e64cfb23f0f8f645ca2fb09f97de15fad 100755 (executable)
@@ -497,14 +497,14 @@ def flush_l2tp_tunnels():
 
 def save_timezone():
     global saved_timezone
-    r = run('timedatectl show --value --property Timezone')
+    r = run(*timedatectl_cmd, 'show', '--value', '--property', 'Timezone', env=env)
     if r.returncode == 0:
         saved_timezone = r.stdout.rstrip()
         print(f'### Saved timezone: {saved_timezone}')
 
 def restore_timezone():
     if saved_timezone:
-        call(f'timedatectl set-timezone {saved_timezone}')
+        call(*timedatectl_cmd, 'set-timezone', f'{saved_timezone}', env=env)
 
 def read_link_attr(*args):
     with open(os.path.join('/sys/class/net', *args), encoding='utf-8') as f: