From aea111ed525ae978d52dbcf815943ce9b3c50fa8 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Thu, 16 Jul 2026 19:49:53 +0200 Subject: [PATCH] change postinst dll.conf for test --- src/debian/postinst | 2 +- tests/postinst.bats | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/debian/postinst b/src/debian/postinst index 96c8ea5..48ab3b4 100755 --- a/src/debian/postinst +++ b/src/debian/postinst @@ -15,7 +15,7 @@ add_entry() grep --silent "$entry" "$DLLCONFIG" && return 0 echo "$entry" >> "$DLLCONFIG" - echo "add kds_s2000w_net to ../build/dll.conf" + echo "add kds_s2000w_net to $DLLCONFIG" } main() diff --git a/tests/postinst.bats b/tests/postinst.bats index 7d78fbf..1d1352c 100755 --- a/tests/postinst.bats +++ b/tests/postinst.bats @@ -4,11 +4,11 @@ setup() { bats_load_library bats-support bats_load_library bats-assert mkdir --parents ../build - touch ../build/dll.conf + touch ../build/dllpostinst.conf } teardown() { - rm -rf ../build/dll.conf + rm -rf ../build/dllpostinst.conf } @test "ignore file does not exists" { @@ -22,27 +22,27 @@ teardown() { } @test "add entry kds_s2000w_net dll.conf" { - export DLLCONFIG="../build/dll.conf" + export DLLCONFIG="../build/dllpostinst.conf" run ../src/debian/postinst assert_success - assert_line --index 0 "found ../build/dll.conf" - assert_line --index 1 "add kds_s2000w_net to ../build/dll.conf" - assert_equal "$(cat ../build/dll.conf)" "kds_s2000w_net" - assert_equal "$(cat ../build/dll.conf | wc --lines)" "1" + assert_line --index 0 "found ../build/dllpostinst.conf" + assert_line --index 1 "add kds_s2000w_net to ../build/dllpostinst.conf" + assert_equal "$(cat ../build/dllpostinst.conf)" "kds_s2000w_net" + assert_equal "$(cat ../build/dllpostinst.conf | wc --lines)" "1" unset DLLCONFIG } @test "entry exists in dll.conf do nothing" { - export DLLCONFIG="../build/dll.conf" + export DLLCONFIG="../build/dllpostinst.conf" run ../src/debian/postinst run ../src/debian/postinst assert_success - assert_output "found ../build/dll.conf" - assert_equal "$(cat ../build/dll.conf)" "kds_s2000w_net" - assert_equal "$(cat ../build/dll.conf | wc --lines)" "1" + assert_output "found ../build/dllpostinst.conf" + assert_equal "$(cat ../build/dllpostinst.conf)" "kds_s2000w_net" + assert_equal "$(cat ../build/dllpostinst.conf | wc --lines)" "1" unset DLLCONFIG } \ No newline at end of file -- 2.47.3