Initial commit for chronos-umbrella
Change-Id: Ice4173f994e049c5ef333046438b27a1a396e234
diff --git a/chronos-umbrella/tests/chronos-umbrella.go b/chronos-umbrella/tests/chronos-umbrella.go
new file mode 100644
index 0000000..9e70d56
--- /dev/null
+++ b/chronos-umbrella/tests/chronos-umbrella.go
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+//
+// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+package tests
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/onosproject/helmit/pkg/helm"
+ "github.com/onosproject/helmit/pkg/input"
+ "github.com/onosproject/helmit/pkg/kubernetes"
+ "github.com/onosproject/helmit/pkg/test"
+ "github.com/onosproject/onos-test/pkg/onostest"
+ "github.com/stretchr/testify/assert"
+)
+
+const aetherCharts = "https://charts.aetherproject.org/"
+
+// ChronosUmbrellaSuite is the chronos-umbrella chart test suite
+type ChronosUmbrellaSuite struct {
+ test.Suite
+ c *input.Context
+}
+
+// SetupTestSuite sets up the chronos umbrella test suite
+func (s *ChronosUmbrellaSuite) SetupTestSuite(c *input.Context) error {
+ s.c = c
+ return nil
+}
+
+func getCredentials() (string, string, error) {
+ kubClient, err := kubernetes.New()
+ if err != nil {
+ return "", "", err
+ }
+ secrets, err := kubClient.CoreV1().Secrets().Get(context.Background(), onostest.SecretsName)
+ if err != nil {
+ return "", "", err
+ }
+ username := string(secrets.Object.Data["sd-ran-username"])
+ password := string(secrets.Object.Data["sd-ran-password"])
+
+ return username, password, nil
+}
+
+// TestInstall tests installing the chronos-umbrella chart
+func (s *ChronosUmbrellaSuite) TestInstall(t *testing.T) {
+ username, password, err := getCredentials()
+ assert.NoError(t, err)
+ registry := s.c.GetArg("registry").String("")
+
+ onos := helm.Chart("chronos-umbrella", aetherCharts).
+ Release("chronos-umbrella").
+ SetUsername(username).
+ SetPassword(password).
+ WithTimeout(15*time.Minute).
+ Set("import.prometheus.chronos.enabled", false).
+ Set("global.image.registry", registry)
+ assert.NoError(t, onos.Install(true))
+}