veyron/runtimes/google/ipc: Add missing vom registration in test.
Without this commit, if the test binary happened to depend on any
package that did something along the lines of:
type T struct{} // i.e., named type for an empty struct
vom.Register(T{}) // i.e., register that type
where T did not implement security.Caveat,
then TestDischargePurgeFromCache would fail because the vom-encoder
would encode an alwaysValidCaveat (also an empty-struct), while
the vom-decoder would try to decode into T, which does not implement
security.Caveat.
Long story short, this missing vom.Register call was an oversight.
Also, included unrelated log message fix.
Change-Id: I0eef28091d7504cfe919535c4545ae6d802e5ba2
diff --git a/runtimes/google/ipc/discharges.go b/runtimes/google/ipc/discharges.go
index c79cf8f..8e390f5 100644
--- a/runtimes/google/ipc/discharges.go
+++ b/runtimes/google/ipc/discharges.go
@@ -128,7 +128,7 @@
wg.Add(1)
go func(i int, cav security.ThirdPartyCaveat) {
defer wg.Done()
- vlog.VI(3).Infof("Fetching discharge for %T from %v", cav.ID(), cav, cav.Location())
+ vlog.VI(3).Infof("Fetching discharge for %T from %v", cav, cav.Location())
call, err := c.StartCall(ctx, cav.Location(), "Discharge", []interface{}{cav}, opts...)
if err != nil {
vlog.VI(3).Infof("Discharge fetch for caveat %T from %v failed: %v", cav, cav.Location(), err)
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 03a3d5a..718b9f8 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -1236,4 +1236,5 @@
blackbox.CommandTable["runProxy"] = runProxy
vom.Register(fakeTimeCaveat(0))
+ vom.Register(alwaysValidCaveat{})
}