mirror of
https://github.com/lingble/talos.git
synced 2025-11-10 18:26:18 +00:00
This is just first steps and core foundation. It can be used like: ``` make integration.test osctl cluster create build/integration.test -test.v ``` This should run the test against the Docker instance. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
// +build integration_api
|
|
|
|
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/talos-systems/talos/internal/integration/base"
|
|
)
|
|
|
|
// VersionSuite verifies version API
|
|
type VersionSuite struct {
|
|
base.APISuite
|
|
}
|
|
|
|
// SuiteName ...
|
|
func (suite *VersionSuite) SuiteName() string {
|
|
return "api.VersionSuite"
|
|
}
|
|
|
|
// SetupSuite ...
|
|
func (suite *VersionSuite) SetupSuite() {
|
|
suite.InitClient()
|
|
}
|
|
|
|
// TearDownSuite ...
|
|
func (suite *VersionSuite) TearDownSuite() {
|
|
if suite.Client != nil {
|
|
suite.Assert().NoError(suite.Client.Close())
|
|
}
|
|
}
|
|
|
|
// TestExpectedVersionMaster verifies master node version matches expected
|
|
func (suite *VersionSuite) TestExpectedVersionMaster() {
|
|
v, err := suite.Client.Version(context.Background())
|
|
suite.Require().NoError(err)
|
|
|
|
suite.Assert().Equal(suite.Version, v.Response[0].Version.Tag)
|
|
}
|
|
|
|
func init() {
|
|
allSuites = append(allSuites, new(VersionSuite))
|
|
}
|