From 9f347fe99634534dc14a82188de8dfffd0d86b22 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 11 Apr 2016 11:23:47 +0200 Subject: [PATCH] functional: introduce a new test TestUnitStatus TestUnitStatus simply checks if "fleetctl status" works. --- functional/unit_action_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/functional/unit_action_test.go b/functional/unit_action_test.go index 9212857bb..10e7438e9 100644 --- a/functional/unit_action_test.go +++ b/functional/unit_action_test.go @@ -278,6 +278,30 @@ func TestUnitCat(t *testing.T) { } } +// TestUnitStatus simply checks "fleetctl status" actually works. +func TestUnitStatus(t *testing.T) { + cluster, err := platform.NewNspawnCluster("smoke") + if err != nil { + t.Fatal(err) + } + defer cluster.Destroy() + + m, err := cluster.CreateMember() + if err != nil { + t.Fatal(err) + } + _, err = cluster.WaitForNMachines(m, 1) + if err != nil { + t.Fatal(err) + } + + // submit a unit and assert it shows up + _, _, err = cluster.Fleetctl(m, "status") + if err != nil { + t.Fatalf("Unable to get fleet status: %v", err) + } +} + // runListUnits runs fleetctl list-units to verify the actual number of units // matches with the given expected number. It periodically runs list-units // waiting until list-units actually shows the expected units.