57 lines
2.7 KiB
Clojure
57 lines
2.7 KiB
Clojure
(ns dda.build.provs.domain-test
|
|
(:require
|
|
[clojure.test :refer [deftest is]]
|
|
[clojure.spec.test.alpha :as st]
|
|
[dda.build.provs.domain :as cut]))
|
|
|
|
(st/instrument `cut/output-path)
|
|
(st/instrument `cut/provs-server-command)
|
|
(st/instrument `cut/create-k3s-config)
|
|
|
|
(deftest should-calculate-output-path
|
|
(is (= "../../target/dda-backup/k3s-out.yaml"
|
|
(cut/output-path {:name "dda-backup"
|
|
:project-root-path "../.."
|
|
:build-dir-name "target"
|
|
:version "4.11.8-dev"
|
|
:stage "dev"
|
|
:debug false
|
|
:dry-run false
|
|
:c4k-output-filename "out.yaml"
|
|
:k3s-provision-user "root"
|
|
:k3s-output-filename "k3s-out.yaml"
|
|
:email "test@test.t"
|
|
:echo false})))
|
|
(is (= "../../target/dda/backup/k3s-out.yaml"
|
|
(cut/output-path {:name "dda"
|
|
:module "backup"
|
|
:project-root-path "../.."
|
|
:build-dir-name "target"
|
|
:version "4.11.8-dev"
|
|
:stage "dev"
|
|
:debug false
|
|
:dry-run false
|
|
:c4k-output-filename "out.yaml"
|
|
:k3s-provision-user "root"
|
|
:k3s-output-filename "k3s-out.yaml"
|
|
:email "test@test.t"
|
|
:echo false}))))
|
|
|
|
(deftest should-calculate-provs-server-command
|
|
(is (= ["provs-server.jar" "k3s" "root@test.test.de" "-c" "../../target/dda-backup/k3s-out.yaml" "-a" "../../target/dda-backup/out.yaml"]
|
|
(cut/provs-server-command {:name "dda-backup"
|
|
:project-root-path "../.."
|
|
:build-dir-name "target"
|
|
:version "4.11.8-dev"
|
|
:stage "dev"
|
|
:debug false
|
|
:dry-run false
|
|
:k3s-output-filename "k3s-out.yaml"
|
|
:k3s-provision-user "root"
|
|
:c4k-config-filename "config.yaml"
|
|
:c4k-auth-filename "auth.yaml"
|
|
:c4k-output-filename "out.yaml"
|
|
:email "test@test.t"
|
|
:echo false}
|
|
{:out {:sensitive false :type [] :value {:fqdn "test.test.de" :ipv4 "127.0.0.1" :ipv6 "::"}}}))))
|
|
|