Skip to content

apparmor: Focus special-character tests on name escaping - #48

Open
vvoland wants to merge 1 commit into
moby:mainfrom
vvoland:gen-special
Open

vvoland wants to merge 1 commit into
moby:mainfrom
vvoland:gen-special

Conversation

@vvoland

@vvoland vvoland commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

@thaJeztah

Copy link
Copy Markdown
Member

Oh! I just merged the other one; I think we could consider keeping the golden one as well; it's there already, and the golden files allow easy asserting the profile all looks honky-dory as a whole.

Adding the extra test probably is ok though.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland

vvoland commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

My concern is that this specific property shouldn't change based on what the apparmor profile itself restricts.

Comment on lines +349 to +352
got := profile.String()
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
if !strings.Contains(got, tc.want) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But isn't this weaker than a .golden file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants