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

Unified Diff: tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go

Issue 2943403003: token-server: Fix panic when generating machine token for unrecognized machine. (Closed)
Patch Set: flatten Created 3 years, 6 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
Index: tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go
diff --git a/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go b/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go
index cb45ea61c3b0806a053509d574cdc02f0f512764..f48f4a84932f12d55fae2974732fc71b884e9ce0 100644
--- a/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go
+++ b/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go
@@ -109,14 +109,13 @@ var testingCA = certconfig.CA{
UpdatedRev: "cfg-updated-rev",
}
-func testingContext() context.Context {
+func testingContext(ca certconfig.CA) context.Context {
ctx := gaetesting.TestingContext()
ctx = info.GetTestable(ctx).SetRequestID("gae-request-id")
ctx, _ = testclock.UseTime(ctx, testingTime)
// Put mocked CA config in the datastore.
- ca := testingCA
- ds.Put(ctx, &ca) // put a copy, Put modifies the object
+ ds.Put(ctx, &ca)
certconfig.StoreCAUniqueIDToCNMap(ctx, map[int64]string{
ca.ParsedConfig.UniqueId: ca.CN,
})

Powered by Google App Engine
This is Rietveld 408576698