More container tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adam Štrauch 2022-02-07 23:59:35 +01:00
parent 157afdcdbe
commit 2405383ff1
Signed by: cx
GPG key ID: 018304FFA8988F8D

View file

@ -92,13 +92,40 @@ func TestProcessorGet(t *testing.T) {
assert.Nil(t, err)
}
// func TestProcessorRegister(t *testing.T) {
func TestProcessorRegister(t *testing.T) {
err := processor.Register(testAppTemplate)
assert.Nil(t, err)
// }
app, err := processor.Get()
assert.Nil(t, err)
assert.Equal(t, "no-container", app.State)
// func TestProcessorUpdate(t *testing.T) {
processor.Delete()
assert.Nil(t, err)
}
// }
func TestProcessorUpdate(t *testing.T) {
err := processor.Create(testAppTemplate)
assert.Nil(t, err)
app, err := processor.Get()
assert.Nil(t, err)
assert.Equal(t, "running", app.State)
updatedTemplate := testAppTemplate
updatedTemplate.Memory = 1024
err = processor.Update(updatedTemplate)
assert.Nil(t, err)
assert.Equal(t, "running", app.State)
app, err = processor.Get()
assert.Nil(t, err)
assert.Equal(t, 1024, app.Memory)
processor.Delete()
assert.Nil(t, err)
}
func TestProcessorDelete(t *testing.T) {
err := processor.Create(testAppTemplate)
@ -122,9 +149,27 @@ func TestProcessorStop(t *testing.T) {
assert.Nil(t, err)
}
// func TestProcessorStart(t *testing.T) {
func TestProcessorStart(t *testing.T) {
err := processor.Create(testAppTemplate)
assert.Nil(t, err)
// }
err = processor.Stop()
assert.Nil(t, err)
app, err := processor.Get()
assert.Nil(t, err)
assert.Equal(t, "exited", app.State)
err = processor.Start()
assert.Nil(t, err)
app, err = processor.Get()
assert.Nil(t, err)
assert.Equal(t, "running", app.State)
processor.Delete()
assert.Nil(t, err)
}
// func TestProcessorRestart(t *testing.T) {