From ab802885688efb5dd5410421ea2c3d1151d24e8c Mon Sep 17 00:00:00 2001
From: JP Ungaretti <git@jungaretti.com>
Date: Wed, 1 Mar 2023 07:57:41 +0000
Subject: Add runtime test

---
 src/dotnet/install.sh                 |  2 +-
 test/dotnet/install_dotnet_runtime.sh | 15 +++++++++++++++
 test/dotnet/scenarios.json            |  9 +++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 test/dotnet/install_dotnet_runtime.sh

diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh
index 4d14a90..455d679 100644
--- a/src/dotnet/install.sh
+++ b/src/dotnet/install.sh
@@ -55,7 +55,7 @@ install_version() {
 
     if [ "$DOTNET_RUNTIME_ONLY" = 'true' ]; then
         echo "Installing runtime only..."
-        runtime_arg = '--runtime dotnet'
+        runtime_arg='--runtime dotnet'
     fi
 
     "$DOTNET_INSTALL_SCRIPT" \
diff --git a/test/dotnet/install_dotnet_runtime.sh b/test/dotnet/install_dotnet_runtime.sh
new file mode 100644
index 0000000..f7f2752
--- /dev/null
+++ b/test/dotnet/install_dotnet_runtime.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# some runtime installed
+check "runtime" bash -c 'test "$(dotnet --list-runtimes | wc -l)" -gt 0'
+
+# no sdk installed
+check "no sdk" bash -c 'test "$(dotnet --list-sdks | wc -l)" -eq 0'
+
+# Report result
+reportResults
diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json
index 120be7e..f865e60 100644
--- a/test/dotnet/scenarios.json
+++ b/test/dotnet/scenarios.json
@@ -47,5 +47,14 @@
                 "version": "7"
             }
         }
+    },
+    "install_dotnet_runtime": {
+        "image": "ubuntu:jammy",
+        "features": {
+            "dotnet": {
+                "version": "6.0.14",
+                "runtimeOnly": true
+            }
+        }
     }
 }
\ No newline at end of file
-- 
cgit v1.2.3