A few more container's tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adam Štrauch 2022-02-07 18:30:42 +01:00
parent c11de8a3e9
commit 157afdcdbe
Signed by: cx
GPG Key ID: 018304FFA8988F8D
2 changed files with 57 additions and 52 deletions

View File

@ -93,7 +93,7 @@ func (c *Container) GetState() (*apps.AppState, error) {
} }
// Status returns state of the container // Status returns state of the container
// Possible values: running, stopped, no-container, unknown // Possible values: running, exited (stopped), no-container, unknown
func (c *Container) Status() (string, error) { func (c *Container) Status() (string, error) {
status := "unknown" status := "unknown"

View File

@ -1,7 +1,6 @@
package glue package glue
import ( import (
"fmt"
"log" "log"
"os" "os"
"path" "path"
@ -67,11 +66,6 @@ func TestMain(m *testing.M) {
exitVal := m.Run() exitVal := m.Run()
// We don't care about output here because we can't do anything about it
//! If testing fails and this won't be performed you have to remove the test container manually
fmt.Println("Removing test container")
processor.Delete()
os.Exit(exitVal) os.Exit(exitVal)
} }
@ -82,9 +76,9 @@ func TestProcessorCreate(t *testing.T) {
assert.Nil(t, err) assert.Nil(t, err)
} }
func TestProcessorList(t *testing.T) { // func TestProcessorList(t *testing.T) {
} // }
func TestProcessorGet(t *testing.T) { func TestProcessorGet(t *testing.T) {
err := processor.Create(testAppTemplate) err := processor.Create(testAppTemplate)
@ -92,19 +86,19 @@ func TestProcessorGet(t *testing.T) {
app, err := processor.Get() app, err := processor.Get()
assert.Nil(t, err) assert.Nil(t, err)
fmt.Println("State", app.State) assert.Equal(t, "running", app.State)
processor.Delete() processor.Delete()
assert.Nil(t, err) assert.Nil(t, err)
} }
func TestProcessorRegister(t *testing.T) { // func TestProcessorRegister(t *testing.T) {
} // }
func TestProcessorUpdate(t *testing.T) { // func TestProcessorUpdate(t *testing.T) {
} // }
func TestProcessorDelete(t *testing.T) { func TestProcessorDelete(t *testing.T) {
err := processor.Create(testAppTemplate) err := processor.Create(testAppTemplate)
@ -114,81 +108,92 @@ func TestProcessorDelete(t *testing.T) {
} }
func TestProcessorStop(t *testing.T) { func TestProcessorStop(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)
processor.Delete()
assert.Nil(t, err)
} }
func TestProcessorStart(t *testing.T) { // func TestProcessorStart(t *testing.T) {
} // }
func TestProcessorRestart(t *testing.T) { // func TestProcessorRestart(t *testing.T) {
} // }
func TestProcessorUpdateKeys(t *testing.T) { // func TestProcessorUpdateKeys(t *testing.T) {
} // }
func TestProcessorSetPassword(t *testing.T) { // func TestProcessorSetPassword(t *testing.T) {
} // }
func TestProcessorProcesses(t *testing.T) { // func TestProcessorProcesses(t *testing.T) {
} // }
func TestProcessorEnableTech(t *testing.T) { // func TestProcessorEnableTech(t *testing.T) {
} // }
func TestProcessorRebuild(t *testing.T) { // func TestProcessorRebuild(t *testing.T) {
} // }
func TestProcessorAddLabel(t *testing.T) { // func TestProcessorAddLabel(t *testing.T) {
} // }
func TestProcessorRemoveLabel(t *testing.T) { // func TestProcessorRemoveLabel(t *testing.T) {
} // }
func TestProcessorGetNode(t *testing.T) { // func TestProcessorGetNode(t *testing.T) {
} // }
func TestProcessorCreateSnapshot(t *testing.T) { // func TestProcessorCreateSnapshot(t *testing.T) {
} // }
func TestProcessorRestoreFromSnapshot(t *testing.T) { // func TestProcessorRestoreFromSnapshot(t *testing.T) {
} // }
func TestProcessorListSnapshots(t *testing.T) { // func TestProcessorListSnapshots(t *testing.T) {
} // }
func TestProcessorListAppsSnapshots(t *testing.T) { // func TestProcessorListAppsSnapshots(t *testing.T) {
} // }
func TestProcessorListSnapshotsByLabel(t *testing.T) { // func TestProcessorListSnapshotsByLabel(t *testing.T) {
} // }
func TestProcessorGetSnapshot(t *testing.T) { // func TestProcessorGetSnapshot(t *testing.T) {
} // }
func TestProcessorGetSnapshotDownloadLink(t *testing.T) { // func TestProcessorGetSnapshotDownloadLink(t *testing.T) {
} // }
func TestProcessorDeleteSnapshot(t *testing.T) { // func TestProcessorDeleteSnapshot(t *testing.T) {
} // }
func TestProcessorDeleteAppSnapshots(t *testing.T) { // func TestProcessorDeleteAppSnapshots(t *testing.T) {
} // }