mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
add tests for functionality
This commit is contained in:
committed by
Alex Dadgar
parent
fba1653057
commit
38f8217ea0
@@ -316,6 +316,24 @@ func TestHTTP_AllocSnapshot(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestHTTP_AllocSnapshot_WithMigrateToken(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert := assert.New(t)
|
||||
httpACLTest(t, nil, func(s *TestAgent) {
|
||||
// TODO add an allocation, assert it is returned
|
||||
|
||||
// Request without a token succeeds
|
||||
req, err := http.NewRequest("GET", "/v1/client/allocation/123/snapshot", nil)
|
||||
assert.Nil(err)
|
||||
|
||||
// Make the unauthorized request
|
||||
respW := httptest.NewRecorder()
|
||||
_, err = s.Server.ClientAllocRequest(respW, req)
|
||||
assert.NotNil(err)
|
||||
assert.Contains(err.Error(), "invalid migrate token")
|
||||
})
|
||||
}
|
||||
|
||||
func TestHTTP_AllocGC(t *testing.T) {
|
||||
t.Parallel()
|
||||
httpTest(t, nil, func(s *TestAgent) {
|
||||
|
||||
Reference in New Issue
Block a user