]> git.ipfire.org Git - ipfire-2.x.git/commit
tests/lib.sh: Add function test_value_in_array
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sun, 16 Jun 2024 16:02:29 +0000 (18:02 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 24 Aug 2024 12:19:56 +0000 (12:19 +0000)
commitdae8a08086150fc12687a41ba30fc5335b6966e6
tree44ca40415278e303eeeeed24bb32293c1216aac0
parent6f4e7823564b5517ff5eccbd358f0c9a2d5e3e27
tests/lib.sh: Add function test_value_in_array

Test if a given array has the specified value stored under key.

! does not work here to access the array by variable name. So the solution here is:
https://unix.stackexchange.com/questions/60584/how-to-use-a-variable-as-part-of-an-array-name/60585#60585

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/lib.sh
tests/src/initscripts/system/functions/test2.sh [new file with mode: 0755]