From a039e6aa8d60509e17e3a22838adb3f6a0ec9264 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 13 May 2022 15:35:09 +0200 Subject: tests: add test for setup-apkrepos --- tests/setup_apkrepos_test | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tests/setup_apkrepos_test diff --git a/tests/setup_apkrepos_test b/tests/setup_apkrepos_test new file mode 100755 index 0000000..bf57b4f --- /dev/null +++ b/tests/setup_apkrepos_test @@ -0,0 +1,22 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh +init_tests \ + setup_apkrepos_usage \ + setup_apkrepos_https + +setup_apkrepos_usage_body() { + test_usage setup-apkrepos +} + +setup_apkrepos_https_body() { + init_env + export MIRRORS="https://a.example.com http://b.example.com" + atf_check -s exit:0 \ + -o match:"Updating repository indexes..." \ + -o match:"apk update" \ + -e empty \ + setup-apkrepos https://example.com + grep -q 'https://example.com' etc/apk/repositories || atf_fail "example.com was not added to /etc/apk/repositories" +} + -- cgit v1.2.3