From baaeb2c2f1e6950bb846bb578f891f04764061d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Thu, 3 Oct 2024 14:37:57 +0200 Subject: [PATCH] Fix tests --- server/tests/compose/namespace_duplicate_test.go | 3 +++ server/tests/compose/namespace_export_automation_test.go | 7 +++++++ server/tests/compose/namespace_export_empty_test.go | 7 +++++++ server/tests/compose/namespace_export_simple_test.go | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/server/tests/compose/namespace_duplicate_test.go b/server/tests/compose/namespace_duplicate_test.go index 2b77760d7..29441f50d 100644 --- a/server/tests/compose/namespace_duplicate_test.go +++ b/server/tests/compose/namespace_duplicate_test.go @@ -86,6 +86,9 @@ func Test_namespace_duplicate(t *testing.T) { helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.search") helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.search") helpers.AllowMe(h, types.NamespaceRbacResource(0), "pages.search") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export") helpers.AllowMe(h, types.NamespaceRbacResource(0), "read") helpers.AllowMe(h, types.ModuleRbacResource(0, 0), "read") helpers.AllowMe(h, types.PageRbacResource(0, 0), "read") diff --git a/server/tests/compose/namespace_export_automation_test.go b/server/tests/compose/namespace_export_automation_test.go index 3a5d19aa9..1d61f261c 100644 --- a/server/tests/compose/namespace_export_automation_test.go +++ b/server/tests/compose/namespace_export_automation_test.go @@ -2,6 +2,9 @@ package compose import ( "testing" + + "github.com/cortezaproject/corteza/server/compose/types" + "github.com/cortezaproject/corteza/server/tests/helpers" ) func Test_namespace_export_automation(t *testing.T) { @@ -12,6 +15,10 @@ func Test_namespace_export_automation(t *testing.T) { ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1") h.a.NoError(err) + helpers.AllowMe(h, types.NamespaceRbacResource(0), "export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export") + arch := namespaceExportSafe(t, h, ns.ID) sessionID := namespaceImportInitSafe(t, h, arch) ns, _, pp, _ := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported") diff --git a/server/tests/compose/namespace_export_empty_test.go b/server/tests/compose/namespace_export_empty_test.go index 22671223d..33d6d26a5 100644 --- a/server/tests/compose/namespace_export_empty_test.go +++ b/server/tests/compose/namespace_export_empty_test.go @@ -2,6 +2,9 @@ package compose import ( "testing" + + "github.com/cortezaproject/corteza/server/compose/types" + "github.com/cortezaproject/corteza/server/tests/helpers" ) func Test_namespace_export_empty(t *testing.T) { @@ -12,6 +15,10 @@ func Test_namespace_export_empty(t *testing.T) { ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1") h.a.NoError(err) + helpers.AllowMe(h, types.NamespaceRbacResource(0), "export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export") + arch := namespaceExportSafe(t, h, ns.ID) sessionID := namespaceImportInitSafe(t, h, arch) ns, mm, pp, cc := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported") diff --git a/server/tests/compose/namespace_export_simple_test.go b/server/tests/compose/namespace_export_simple_test.go index 223eb467e..dd3d39fb4 100644 --- a/server/tests/compose/namespace_export_simple_test.go +++ b/server/tests/compose/namespace_export_simple_test.go @@ -2,6 +2,9 @@ package compose import ( "testing" + + "github.com/cortezaproject/corteza/server/compose/types" + "github.com/cortezaproject/corteza/server/tests/helpers" ) func Test_namespace_export_simple(t *testing.T) { @@ -12,6 +15,10 @@ func Test_namespace_export_simple(t *testing.T) { ns, _, _, _, _, err := fetchEntireNamespace(ctx, s, "ns1") h.a.NoError(err) + helpers.AllowMe(h, types.NamespaceRbacResource(0), "export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "modules.export") + helpers.AllowMe(h, types.NamespaceRbacResource(0), "charts.export") + arch := namespaceExportSafe(t, h, ns.ID) sessionID := namespaceImportInitSafe(t, h, arch) ns, mm, pp, cc := namespaceImportRun(ctx, s, t, h, sessionID, "imported", "imported")