Multiple changes to the test framework. Interim commit
to avoid losing code if my VM crashes
Change-Id: I5f03db81851dba1fb0c944c8e5f3a845ddbec2c8
diff --git a/tests/afrouter/templates/server.go b/tests/afrouter/templates/server.go
index 8461d38..85c3b93 100644
--- a/tests/afrouter/templates/server.go
+++ b/tests/afrouter/templates/server.go
@@ -136,12 +136,16 @@
// Send the server information back to the test framework
ts.control.incmg <- r
// Read the value that needs to be returned from the channel
- d := <-ts.control.replyData
- switch r := d.repl.(type) {
- case *{{.Rtrn}}:
- return r, nil
- default:
- return nil, errors.New("Mismatched type in call to {{.Name}}")
+ select {
+ case d := <-ts.control.replyData:
+ switch r := d.repl.(type) {
+ case *{{.Rtrn}}:
+ return r, nil
+ default:
+ return nil, errors.New("Mismatched type in call to {{.Name}}")
+ }
+ default:
+ return nil, errors.New("Nothing in the reply data channel in call to {{.Name}}, sending nil")
}
return &{{.Rtrn}}{},nil
}