|
|
@ -664,6 +664,29 @@ func TestAgent_checkTokens(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestAgent_nestedPauseResume(t *testing.T) {
|
|
|
|
|
|
|
|
l := new(localState)
|
|
|
|
|
|
|
|
if l.isPaused() != false {
|
|
|
|
|
|
|
|
t.Fatal("localState should be unPaused after init")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
l.Pause()
|
|
|
|
|
|
|
|
if l.isPaused() != true {
|
|
|
|
|
|
|
|
t.Fatal("localState should be Paused after first call to Pause()")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
l.Pause()
|
|
|
|
|
|
|
|
if l.isPaused() != true {
|
|
|
|
|
|
|
|
t.Fatal("localState should STILL be Paused after second call to Pause()")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
l.Resume()
|
|
|
|
|
|
|
|
if l.isPaused() != true {
|
|
|
|
|
|
|
|
t.Fatal("localState should STILL be Paused after FIRST call to Resume()")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
l.Resume()
|
|
|
|
|
|
|
|
if l.isPaused() != false {
|
|
|
|
|
|
|
|
t.Fatal("localState should NOT be Paused after SECOND call to Resume()")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var testRegisterRules = `
|
|
|
|
var testRegisterRules = `
|
|
|
|
service "api" {
|
|
|
|
service "api" {
|
|
|
|
policy = "write"
|
|
|
|
policy = "write"
|
|
|
|