]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: escape '+' from uname -r before using in regex via '=~'
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 24 Jun 2025 12:07:11 +0000 (13:07 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 24 Jun 2025 20:44:13 +0000 (05:44 +0900)
commita0dfb0245662e31ded34730010e0e92be9bd9f1a
tree523fd536221ac380e634c5aec2d6c58b575e3d29
parent736b6277752a05f67e47a5b80977949486189e39
test: escape '+' from uname -r before using in regex via '=~'

It will otherwise interpret characters such as '+' as if they
were regex, and break matching.

For example TEST-71-HOSTNAME started failing when
uname -r started including a '+':

FAIL: 'Kernel: Linux 6.12.33+deb13-amd64' not found in:
 Static hostname: host
       Icon name: computer-vm
         Chassis: vm ðŸ–´
      Machine ID: e6471c1f95ab49098827498ed816cdf7
         Boot ID: 231da987f64d4af59f2076fbb638c611
  Virtualization: kvm
Operating System: Debian GNU/Linux 13 (trixie)
          Kernel: Linux 6.12.33+deb13-amd64
    Architecture: x86-64
test/units/TEST-17-UDEV.link-property.sh
test/units/TEST-71-HOSTNAME.sh