Skip to content

Commit

Permalink
Added more testcases
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Sethiya <[email protected]>
  • Loading branch information
Yash Sethiya authored and Yash Sethiya committed Jan 25, 2024
1 parent 4a9d900 commit 57c820a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/fetch/vendir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Test_GitURL_skipsTLS(t *testing.T) {
Namespace: "default",
},
Data: map[string]string{
"dangerousSkipTLSVerify": "github.com, gitlab.com, hostname.com",
"dangerousSkipTLSVerify": "github.com, gitlab.com, hostname.com, 0.0.0.0",
},
}
k8scs := k8sfake.NewSimpleClientset(configMap)
Expand All @@ -84,6 +84,7 @@ func Test_GitURL_skipsTLS(t *testing.T) {
{"https://gitlab.com/bitnami/charts/", true},
{"ssh://[email protected]:/path/to/repo.git", true},
{"https://bitbucket.org/bitnami/charts/", false},
{"https://0.0.0.0/bitnami/charts/", true},
}
for i, tc := range testCases {
err = vendir.AddDir(v1alpha1.AppFetch{
Expand All @@ -93,6 +94,8 @@ func Test_GitURL_skipsTLS(t *testing.T) {
assert.NoError(t, err)

vConf := vendir.Config()
t.Logf("%+v", vConf)
t.Logf("%+v", vConf.Directories[i].Contents[0].Git)
assert.Equal(t, i+1, len(vConf.Directories), "Failed on iteration %d", i)
assert.Equal(t, tc.shouldSkipTLS, vConf.Directories[i].Contents[0].Git.DangerousSkipTLSVerify, "Failed with URL %s", tc.URL)
}
Expand Down

0 comments on commit 57c820a

Please sign in to comment.