about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1')
-rw-r--r--nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/default.nix11
-rw-r--r--nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/input.yaml7
-rw-r--r--nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/output.tf12
3 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/default.nix b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/default.nix
new file mode 100644
index 000000000000..6b06dbf32340
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/default.nix
@@ -0,0 +1,11 @@
+{ runCommandCC, tfk8s }:
+
+runCommandCC "tfk8s-test-sample1" {
+    buildInputs = [
+      tfk8s
+    ];
+    meta.timeout = 60;
+  }
+  ''
+    cmp <(${tfk8s}/bin/tfk8s -f ${./input.yaml}) ${./output.tf} > $out
+  ''
diff --git a/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/input.yaml b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/input.yaml
new file mode 100644
index 000000000000..58ed0eb11d76
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/input.yaml
@@ -0,0 +1,7 @@
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: test
+data:
+  TEST: test
diff --git a/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/output.tf b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/output.tf
new file mode 100644
index 000000000000..51d564400b55
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/tfk8s/tests/sample1/output.tf
@@ -0,0 +1,12 @@
+resource "kubernetes_manifest" "configmap_test" {
+  manifest = {
+    "apiVersion" = "v1"
+    "data" = {
+      "TEST" = "test"
+    }
+    "kind" = "ConfigMap"
+    "metadata" = {
+      "name" = "test"
+    }
+  }
+}