diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-24 14:33:52 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-24 15:00:08 +0100 |
commit | 9fb734a44181c285217d1ea5454a7936dbfd30d4 (patch) | |
tree | ef0b7075ae2e8cc8ccfb15fb3b8b3e07eb23d1b2 | |
parent | 6bd38f5187aded22a81e23c203ed2f8c725a38d4 (diff) | |
download | alpine-conf-9fb734a44181c285217d1ea5454a7936dbfd30d4.zip |
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
-rwxr-xr-x | tests/setup_apkrepos_test | 32 |
1 files changed, 31 insertions, 1 deletions
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 +} |