From 40d15db038958fd821000399420b212c2174198c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 22 May 2023 11:26:38 +0200 Subject: [PATCH] Use fake getent to avoid existing system users The default user may or may not exist on the system running the tests. Create a fake getent to simulate non-existing user in a consistent way. fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/42 --- tests/init-boot.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/init-boot.test b/tests/init-boot.test index ddb102a..df50447 100755 --- a/tests/init-boot.test +++ b/tests/init-boot.test @@ -114,6 +114,10 @@ enable_sshd_body() { } create_default_user_body() { + fake_bin getent <<-EOF + #!/bin/sh + exit 2 + EOF atf_check \ -o match:"addgroup alpine" \ -o match:"adduser.*alpine" \