Skip to content

Commit

Permalink
Add Authfile generation test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Jan 30, 2024
1 parent 360b81a commit 6620ffe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xrootd/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,8 @@ func TestWriteOriginAuthFiles(t *testing.T) {

originAuthTester := func(server server_utils.XRootDServer, authStart string, authResult string) func(t *testing.T) {
return func(t *testing.T) {

defer viper.Reset()
dirname := t.TempDir()
viper.Reset()
viper.Set("Xrootd.RunLocation", dirname)
viper.Set("Xrootd.ScitokensConfig", filepath.Join(dirname, "scitokens-generated.cfg"))
viper.Set("Xrootd.Authfile", filepath.Join(dirname, "authfile"))
Expand Down Expand Up @@ -327,6 +326,10 @@ func TestWriteOriginAuthFiles(t *testing.T) {
originServer.SetNamespaceAds(nsAds)

t.Run("EmptyAuth", originAuthTester(originServer, "", "u * /.well-known lr\n"))

viper.Set("Origin.EnablePublicReads", true)
viper.Set("Origin.NamespacePrefix", "/foo/bar")
t.Run("PublicAuth", originAuthTester(originServer, "", "u * /.well-known lr /foo/bar lr\n"))
}

func TestWriteCacheAuthFiles(t *testing.T) {
Expand Down

0 comments on commit 6620ffe

Please sign in to comment.