Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: milo/appengine/buildbot/build_test.go

Issue 2271453002: Milo: Internal buildbot masters support (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: nit fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/buildbot/build.go ('k') | milo/appengine/buildbot/builder.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/build_test.go
diff --git a/milo/appengine/buildbot/build_test.go b/milo/appengine/buildbot/build_test.go
index 7a4337680320750b71c8422ae51949a4a5963cb7..c045f66d2d1d942c80d17e5960d3a2fff8654195 100644
--- a/milo/appengine/buildbot/build_test.go
+++ b/milo/appengine/buildbot/build_test.go
@@ -14,7 +14,9 @@ import (
"testing"
"github.com/luci/gae/impl/memory"
+ "github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/clock/testclock"
+ "github.com/luci/luci-go/milo/common/miloerror"
. "github.com/smartystreets/goconvey/convey"
"golang.org/x/net/context"
)
@@ -71,5 +73,21 @@ func TestBuild(t *testing.T) {
So(build, shouldMatchExpectationsFor, fname)
})
}
+
+ Convey(`Disallow anonomyous users from accessing internal builds`, func() {
+ ds := datastore.Get(c)
+ ds.Put(&buildbotBuild{
+ Master: "fake",
+ Buildername: "fake",
+ Number: 1,
+ Internal: true,
+ })
+ b, err := getBuild(c, "fake", "fake", "1")
+ So(b, ShouldBeNil)
+ So(err, ShouldResemble, miloerror.Error{
+ Message: "Cannot fetch project buildbot-internal:\ndatastore: no such entity",
+ Code: 500,
+ })
+ })
})
}
« no previous file with comments | « milo/appengine/buildbot/build.go ('k') | milo/appengine/buildbot/builder.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698