clean up coturn & add over all test
This commit is contained in:
parent
56366785aa
commit
80ad4b720d
6 changed files with 17 additions and 34 deletions
src
main
cljc/dda/c4k_jitsi
resources/jitsi
test/cljc/dda/c4k_jitsi
|
@ -77,6 +77,5 @@
|
|||
#(not (nil? %))
|
||||
(cm/concat-vec
|
||||
(jitsi/prosody-auth config auth)
|
||||
(jitsi/coturn-auth config auth)
|
||||
(when (:contains? config :mon-cfg)
|
||||
(mon/generate-auth (:mon-cfg config) (:mon-auth auth))))))))
|
||||
|
|
|
@ -163,18 +163,11 @@
|
|||
(let [{:keys [namespace]} config]
|
||||
[(load-and-adjust-namespace "jitsi/modelector-config-service.yaml" namespace)
|
||||
(load-and-adjust-namespace "jitsi/modelector-config-deployment.yaml" namespace)]))
|
||||
|
||||
(defn-spec coturn-auth cp/map-or-seq?
|
||||
[config config?
|
||||
auth auth?]
|
||||
(let [{:keys [namespace]} config
|
||||
{:keys []} auth]
|
||||
[(load-and-adjust-namespace "jitsi/coturn-auth-secret.yaml" namespace)]))
|
||||
|
||||
(defn-spec coturn-config cp/map-or-seq?
|
||||
[config config?]
|
||||
(let [{:keys [namespace fqdn]} config]
|
||||
[(load-and-adjust-namespace "jitsi/coturn-config-default-cm.yaml" namespace)
|
||||
[(load-and-adjust-namespace "jitsi/coturn-config-extra-cm.yaml" namespace)
|
||||
(->
|
||||
(load-and-adjust-namespace "jitsi/coturn-config-init-cm.yaml" namespace)
|
||||
(cm/replace-key-value
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
namespace: NAMESPACE
|
||||
name: coturn-auth-secret
|
||||
labels:
|
||||
app.kubernetes.io/name: "coturn"
|
||||
data:
|
||||
username: ""
|
||||
password: ""
|
|
@ -1,20 +1,28 @@
|
|||
(ns dda.c4k-jitsi.core-test
|
||||
(:require
|
||||
#?(:cljs [shadow.resource :as rc])
|
||||
#?(:clj [clojure.test :refer [deftest is are testing run-tests]]
|
||||
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
|
||||
[clojure.spec.alpha :as s]
|
||||
[dda.c4k-common.yaml :as yaml]
|
||||
[dda.c4k-jitsi.core :as cut]))
|
||||
[dda.c4k-jitsi.core :as cut]
|
||||
#?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]])))
|
||||
|
||||
|
||||
#?(:cljs
|
||||
(defmethod yaml/load-resource :jitsi-test [resource-name]
|
||||
(case resource-name
|
||||
"jitsi-test/valid-auth.yaml" (rc/inline "jitsi-test/valid-auth.yaml")
|
||||
"jitsi-test/valid-config.yaml" (rc/inline "jitsi-test/valid-config.yaml")
|
||||
(throw (js/Error. "Undefined Resource!")))))
|
||||
(get (inline-resources "jitsi-test") resource-name)))
|
||||
|
||||
(deftest validate-valid-resources
|
||||
(is (s/valid? cut/config? (yaml/load-as-edn "jitsi-test/valid-config.yaml")))
|
||||
(is (s/valid? cut/auth? (yaml/load-as-edn "jitsi-test/valid-auth.yaml")))
|
||||
)
|
||||
(is (s/valid? cut/auth? (yaml/load-as-edn "jitsi-test/valid-auth.yaml"))))
|
||||
|
||||
(deftest test-whole-generation
|
||||
(is (= 63
|
||||
(count
|
||||
(cut/config-objects
|
||||
(yaml/load-as-edn "jitsi-test/valid-config.yaml")))))
|
||||
(is (= 6
|
||||
(count
|
||||
(cut/auth-objects
|
||||
(yaml/load-as-edn "jitsi-test/valid-config.yaml")
|
||||
(yaml/load-as-edn "jitsi-test/valid-auth.yaml"))))))
|
|
@ -168,13 +168,6 @@
|
|||
:namespace "jitsi"})))))
|
||||
|
||||
(deftest should-generate-coturn
|
||||
(is (= 1
|
||||
(count (cut/coturn-auth
|
||||
{:fqdn "xy.xy.xy"
|
||||
:namespace "jitsi"}
|
||||
{:jvb-auth-password "jvb-auth"
|
||||
:jicofo-auth-password "jicofo-auth"
|
||||
:jicofo-component-secret "jicofo-comp"}))))
|
||||
(is (= 5
|
||||
(count (cut/coturn-config
|
||||
{:fqdn "xy.xy.xy"
|
||||
|
|
Loading…
Reference in a new issue