-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from shaior/talm_suite
Set talm suite and util functions
- Loading branch information
Showing
4 changed files
with
257 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package tests | ||
|
||
import ( | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
"github.com/openshift-kni/eco-goinfra/pkg/clients" | ||
"github.com/openshift-kni/eco-goinfra/pkg/namespace" | ||
"github.com/openshift-kni/eco-gosystem/tests/gitopsztp/talm/internal/talmhelper" | ||
"github.com/openshift-kni/eco-gosystem/tests/internal/cluster" | ||
) | ||
|
||
var _ = Describe("Talm Canary Tests", Ordered, Label("talmcanary"), func() { | ||
|
||
var clusterList []*clients.Settings | ||
|
||
BeforeAll(func() { | ||
// Initialize cluster list | ||
clusterList = talmhelper.GetAllTestClients() | ||
}) | ||
|
||
BeforeEach(func() { | ||
// Check that the required clusters are present | ||
err := cluster.CheckClustersPresent(clusterList) | ||
if err != nil { | ||
Skip(fmt.Sprintf("error occurred validating required clusters are present: %s", err.Error())) | ||
} | ||
|
||
// Cleanup state to make it consistent | ||
for _, client := range clusterList { | ||
|
||
// Cleanup everything | ||
errList := talmhelper.CleanupTestResourcesOnClients( | ||
[]*clients.Settings{ | ||
client, | ||
}, | ||
talmhelper.CguName, | ||
talmhelper.PolicyName, | ||
talmhelper.Namespace, | ||
talmhelper.PlacementBindingName, | ||
talmhelper.PlacementRule, | ||
talmhelper.PolicySetName, | ||
talmhelper.CatalogSourceName) | ||
Expect(errList).To(BeEmpty()) | ||
|
||
// Create namespace | ||
_, err := namespace.NewBuilder(client, talmhelper.Namespace).Create() | ||
Expect(err).ToNot(HaveOccurred()) | ||
} | ||
|
||
// Cleanup the temporary namespace | ||
err = talmhelper.CleanupNamespace(clusterList, talmhelper.TemporaryNamespaceName) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
}) |