From 9d1d448a16451d1e4719e32e7acd57689a88286f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 28 Jun 2024 12:32:59 +0200 Subject: [PATCH] Add incus autodetect --- lib/tiny-cloud/cloud/incus/autodetect | 3 +++ tests/init.test | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100755 lib/tiny-cloud/cloud/incus/autodetect diff --git a/lib/tiny-cloud/cloud/incus/autodetect b/lib/tiny-cloud/cloud/incus/autodetect new file mode 100755 index 0000000..bdb5cc7 --- /dev/null +++ b/lib/tiny-cloud/cloud/incus/autodetect @@ -0,0 +1,3 @@ +#!/bin/sh + +test -e "$ROOT"/dev/incus/sock && echo "10 incus" diff --git a/tests/init.test b/tests/init.test index 0a00008..d8d11b0 100755 --- a/tests/init.test +++ b/tests/init.test @@ -25,6 +25,7 @@ init_tests \ userdata_type \ run_userdata \ autodetect_unknown \ + autodetect_incus \ autodetect_nocloud_cmdline \ autodetect_nocloud_dmi \ autodetect_nocloud_volume @@ -236,6 +237,14 @@ autodetect_unknown_body() { sh -c ". \"$lib\"; echo \$CLOUD" } +autodetect_incus_body() { + mkdir -p dev/incus + touch dev/incus/sock + atf_check \ + -o match:"incus" \ + sh -c ". \"$lib\"; echo \$CLOUD" +} + autodetect_nocloud_cmdline_body() { mkdir -p proc echo "quiet ds=nocloud;s=https://10.42.42.42/ console=ttyS0" > proc/cmdline