From 61c750d5e144eca46749d52fe4bad1a5e5bd422e Mon Sep 17 00:00:00 2001 From: Mina Ashraf Date: Fri, 28 Jul 2023 07:34:06 +0000 Subject: [PATCH] test for dots and @ --- internal/jujuapi/access_control_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/jujuapi/access_control_test.go b/internal/jujuapi/access_control_test.go index 6825d3b61..22d6ae293 100644 --- a/internal/jujuapi/access_control_test.go +++ b/internal/jujuapi/access_control_test.go @@ -303,6 +303,17 @@ func (s *accessControlSuite) TestAddRelation(c *gc.C) { err: false, changesType: "group", }, + //Test username with dots and @ -> group + { + input: tuple{"user-" + "kelvin.lina.test@external", "member", "group-" + group.Name}, + want: createTupleKey( + "user:"+"kelvin.lina.test@external", + "member", + "group:"+strconv.FormatUint(uint64(group.ID), 10), + ), + err: false, + changesType: "group", + }, //Test group -> controller { input: tuple{"group-" + "test-group#member", "administrator", "controller-" + controller.UUID},