summaryrefslogtreecommitdiff
path: root/tests/update_kernel_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 16:01:45 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-12 16:23:50 +0200
commitde440ee3dd7a852073e16bf732af17a2f8d39301 (patch)
treedc0d26303aaff151fbae80435ae3bceb5c45ef8e /tests/update_kernel_test
parentc82cb4f416c184954f4e3429288a41a4f53b4089 (diff)
downloadalpine-conf-de440ee3dd7a852073e16bf732af17a2f8d39301.zip
tests: add a few tests for update_kernel
Diffstat (limited to 'tests/update_kernel_test')
-rwxr-xr-xtests/update_kernel_test36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/update_kernel_test b/tests/update_kernel_test
new file mode 100755
index 0000000..9effe33
--- /dev/null
+++ b/tests/update_kernel_test
@@ -0,0 +1,36 @@
+#!/usr/bin/env atf-sh
+
+. $(atf_get_srcdir)/test_env.sh
+init_tests \
+ update_kernel_usage \
+ update_kernel_builddir_and_flavor \
+ update_kernel_arch \
+ update_kernel_flavor
+
+update_kernel_usage_body() {
+ test_usage update-kernel
+}
+
+update_kernel_builddir_and_flavor_body() {
+ init_env
+ atf_check -s exit:1 \
+ -o empty \
+ -e match:"Cannot specify both build directory and flavor" \
+ update-kernel --build-dir tmp --flavor virt
+}
+
+update_kernel_arch_body() {
+ init_env
+ atf_check -s exit:1 \
+ -o empty \
+ -e match:"Cannot specify architecture when updating the current kernel" \
+ update-kernel --arch foobar
+}
+
+update_kernel_flavor_body() {
+ init_env
+ atf_check -s exit:1 \
+ -o empty \
+ -e match:"Cannot specify flavor when updating the current kernel" \
+ update-kernel --flavor virt
+}