From 9fb734a44181c285217d1ea5454a7936dbfd30d4 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 24 Jan 2023 14:33:52 +0100 Subject: tests: version detection for edge ref: https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10548 ref: https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/137 --- tests/setup_apkrepos_test | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'tests/setup_apkrepos_test') diff --git a/tests/setup_apkrepos_test b/tests/setup_apkrepos_test index d505d46..2b87d30 100755 --- a/tests/setup_apkrepos_test +++ b/tests/setup_apkrepos_test @@ -9,7 +9,9 @@ init_tests \ setup_apkrepos_first \ setup_apkrepos_fastest \ setup_apkrepos_network_failure \ - setup_apkrepos_interactive + setup_apkrepos_interactive \ + setup_apkrepos_alpine_stable \ + setup_apkrepos_alpine_edge setup_apkrepos_usage_body() { test_usage setup-apkrepos @@ -84,3 +86,31 @@ setup_apkrepos_interactive_body() { setup-apkrepos < answers } +setup_apkrepos_alpine_stable_body() { + init_env + export WGETCONTENT="$(seq 0 9 | awk '{print "https://a" $0 ".example.com"}')" + mkdir -p etc + echo "3.17.0" > etc/alpine-release + atf_check -s exit:0 \ + -o match:"Added mirror a0.example.com" \ + setup-apkrepos -1 + atf_check -o match:"v3\.17" cat etc/apk/repositories +} + +setup_apkrepos_alpine_edge_body() { + init_env + export WGETCONTENT="$(seq 0 9 | awk '{print "https://a" $0 ".example.com"}')" + mkdir -p etc etc/apk + # edge may have a .0 in etc/alpine-release + echo "3.17.0" > etc/alpine-release + echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" > etc/apk/repositories + + atf_check -s exit:0 \ + -o match:"Added mirror a0.example.com" \ + setup-apkrepos -1 + + atf_check \ + -o match:"https://a0.example.com/edge/main" \ + -o not-match:"v3\.17" \ + cat etc/apk/repositories +} -- cgit v1.2.3