From db0c8bec6cadee9bd69462848a9db667169db967 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 13 Nov 2018 21:48:38 -0800 Subject: [PATCH] tests/e2e: test cluster version Signed-off-by: Gyuho Lee --- tests/e2e/etcd_release_upgrade_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/e2e/etcd_release_upgrade_test.go b/tests/e2e/etcd_release_upgrade_test.go index 4b65dad3b22a..018a21f6d875 100644 --- a/tests/e2e/etcd_release_upgrade_test.go +++ b/tests/e2e/etcd_release_upgrade_test.go @@ -103,6 +103,15 @@ func TestReleaseUpgrade(t *testing.T) { } } } + + // expect upgraded cluster version + ver := version.Version + if strings.HasSuffix(ver, "+git") { + ver = strings.Replace(ver, "+git", "", 1) + } + if err := cURLGet(cx.epc, cURLReq{endpoint: "/metrics", expected: fmt.Sprintf(`etcd_cluster_version{cluster_version="%s"} 1`, ver), metricsURLScheme: cx.cfg.metricsURLScheme}); err != nil { + cx.t.Fatalf("failed get with curl (%v)", err) + } } func TestReleaseUpgradeWithRestart(t *testing.T) {