selftests/nolibc: chdir_root: restore current path after test
authorZhangjin Wu <falcon@tinylab.org>
Fri, 7 Jul 2023 18:42:01 +0000 (02:42 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 02:38:02 +0000 (04:38 +0200)
commit38fc0a3553ced0158d97047f5fb3b73898226a3c
treefcebe75a8c137872458c9f863f8465318e8c5f73
parent6861b1a3398ec3f1b830d7d190a6ffbc3be8ab6b
selftests/nolibc: chdir_root: restore current path after test

The PWD environment variable has the path of the nolibc-test program,
the current path must be the same as it, otherwise, the test cases will
fail with relative path (e.g. ./nolibc-test).

Since only chdir_root really changes the current path, let's restore it
with the PWD environment variable.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/testing/selftests/nolibc/nolibc-test.c