From e0bc1ebe759f65dad7b89e11175be0263bca8713 Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Tue, 7 May 2024 11:13:27 +0600 Subject: [PATCH] test: add testcase with recursive symlinks --- pkg/iac/scanners/helm/parser/parser_test.go | 4 ++++ .../testdata/archive-with-symlinks/chart.tar.gz | Bin 247 -> 312 bytes 2 files changed, 4 insertions(+) diff --git a/pkg/iac/scanners/helm/parser/parser_test.go b/pkg/iac/scanners/helm/parser/parser_test.go index b9a58238280b..9c8b05ce7696 100644 --- a/pkg/iac/scanners/helm/parser/parser_test.go +++ b/pkg/iac/scanners/helm/parser/parser_test.go @@ -29,6 +29,8 @@ func TestParseFS(t *testing.T) { // mkdir -p dir && cp -p Chart.yaml dir/Chart.yaml // mkdir -p sym-to-file && ln -s ../Chart.yaml sym-to-file/Chart.yaml // ln -s dir sym-to-dir + // mkdir rec-sym && touch rec-sym/Chart.yaml + // ln -s . ./rec-sym/a // cd .. && tar -czvf chart.tar.gz chart && rm -rf chart p, err := New(".") require.NoError(t, err) @@ -39,6 +41,8 @@ func TestParseFS(t *testing.T) { expectedFiles := []string{ "chart/Chart.yaml", "chart/dir/Chart.yaml", + "chart/rec-sym/Chart.yaml", + "chart/rec-sym/a/Chart.yaml", "chart/sym-to-dir/Chart.yaml", "chart/sym-to-file/Chart.yaml", } diff --git a/pkg/iac/scanners/helm/parser/testdata/archive-with-symlinks/chart.tar.gz b/pkg/iac/scanners/helm/parser/testdata/archive-with-symlinks/chart.tar.gz index 4e9ee88c4789593b3684ba994378deeff869e10b..a3183710c17f5dd1d04935cfd2731450a83df2b5 100644 GIT binary patch literal 312 zcmV-80muFyiwFSaw>f421MQbxYQr!LfO8aIAenz;`2ahKNgGyZC^+duZ$Bjt9a+nm zVKR*B3)n9vR{U9t-G9V1zcs9At%LV!?J@V-Lhd(|0W|2G3)(4doCnt^&l^_eI?XXr zDD!2aXN>9kd>joMh9BOueaF53C-kfTbnM&dHZtvlBL5D_zc)^c{~Bcf?@Qa=;&|qm zgVqB9e&-)?^$&=R(j38jNBooj!znTT14{BAgCYOmte5<+LH19zznw2FZ3B)u%KQiN zk0wz5Tc&t+i2pDD!|8lvr~_sGVX6PY1j+vzJo^9pvp}(bYeJySA+fik7o~*_|Nx$YQ6Zc!QOvlnWLosZ})$<-pK2gpEx6hiJiWQ3SF(oJh-==!3SRQhu# zS5vgZ>vgiMEZ;n5d5<;z3Hz)6-E>dKqNz3Zkn>=~5B&p+e?p?fd5vTqG5_NKP_>FZ zAg=yF{9^`I|36{&-;K?tKX2qS(AXos|1+@Ee^AQj4)cHWUsm-|p%29Q$EpA4o~{0W x!L$GG&jQi@1LQ3IKcuPhWRjTw_5ZJT((&^jhb*)C&oB%_lM6)8s~P|j006+Qf~Wuh