]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #25166 from yuwata/network-router-preference
authorLuca Boccassi <bluca@debian.org>
Mon, 31 Oct 2022 19:59:36 +0000 (20:59 +0100)
committerGitHub <noreply@github.com>
Mon, 31 Oct 2022 19:59:36 +0000 (20:59 +0100)
network: adjust route metric based on router preference

1  2 
man/systemd.network.xml
src/network/networkd-dhcp-common.c
test/test-network/systemd-networkd-tests.py

Simple merge
Simple merge
index 87710ef3fb6651f7084a26939d819b67ea0949f2,64924a35aa582633d6ad325f47d0080392952873..de339894afe7b0764df80af6961f07b069ef2544
@@@ -907,13 -889,23 +907,23 @@@ class Utilities()
  
          self.assertNotRegex(output, address_regex)
  
+     def wait_route(self, link, route_regex, table='main', ipv='', timeout_sec=100):
+         for i in range(timeout_sec):
+             if i > 0:
+                 time.sleep(1)
+             output = check_output(f'ip {ipv} route show dev {link} table {table}')
+             if re.search(route_regex, output):
+                 break
+         self.assertRegex(output, route_regex)
      def check_netlabel(self, interface, address, label='system_u:object_r:root_t:s0'):
          if not shutil.which('selinuxenabled'):
 -            print(f'## Checking NetLabel skipped: selinuxenabled command not found.')
 +            print('## Checking NetLabel skipped: selinuxenabled command not found.')
          elif call_quiet('selinuxenabled') != 0:
 -            print(f'## Checking NetLabel skipped: SELinux disabled.')
 +            print('## Checking NetLabel skipped: SELinux disabled.')
          elif not shutil.which('netlabelctl'): # not packaged by all distros
 -            print(f'## Checking NetLabel skipped: netlabelctl command not found.')
 +            print('## Checking NetLabel skipped: netlabelctl command not found.')
          else:
              output = check_output('netlabelctl unlbl list')
              print(output)