mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-15 02:57:17 +02:00
This class of tests is included/excluded by build tags, but as it is pretty different from other integration tests, we build it as separate executable. Provision tests provision cluster for the test run, perform some actions and verify results (could be upgrade, reset, scale up/down, etc.) There's now framework to implement upgrade tests, first of the tests tests upgrade from latest 0.3 (0.3.2 at the moment) to current version of Talos (being built in CI). Tests starts by booting with 0.3 kernel/initramfs, runs 0.3 installer to install 0.3.2 cluster, wait for bootstrap, followed by upgrade to 0.4 in rolling fashion. As Firecracker supports bootloader, this boots 0.4 system from boot disk (as installed by installer). Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
57 lines
1.5 KiB
Go
57 lines
1.5 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
|
|
|
|
// Package provision provides integration tests which rely on on provisioning cluster per test.
|
|
package provision
|
|
|
|
import (
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"github.com/talos-systems/talos/internal/integration/base"
|
|
)
|
|
|
|
var allSuites []suite.TestingSuite
|
|
|
|
// GetAllSuites returns all the suites for provision test.
|
|
//
|
|
// Depending on build tags, this might return different lists.
|
|
func GetAllSuites() []suite.TestingSuite {
|
|
return allSuites
|
|
}
|
|
|
|
// Settings for provision tests.
|
|
type Settings struct {
|
|
// CIDR to use for provisioned clusters
|
|
CIDR string
|
|
// Registry mirrors to push to Talos config, in format `host=endpoint`
|
|
RegistryMirrors base.StringList
|
|
// MTU for the network.
|
|
MTU int
|
|
// VM parameters
|
|
CPUs int64
|
|
MemMB int64
|
|
DiskGB int64
|
|
// Node count for the tests
|
|
MasterNodes int
|
|
WorkerNodes int
|
|
// Target installer image registry
|
|
TargetInstallImageRegistry string
|
|
// Current version of the cluster (built in the CI pass)
|
|
CurrentVersion string
|
|
}
|
|
|
|
// DefaultSettings filled in by test runner.
|
|
var DefaultSettings Settings = Settings{
|
|
CIDR: "172.21.0.0/24",
|
|
MTU: 1500,
|
|
CPUs: 1,
|
|
MemMB: 1.5 * 1024,
|
|
DiskGB: 4,
|
|
MasterNodes: 3,
|
|
WorkerNodes: 1,
|
|
TargetInstallImageRegistry: "docker.io",
|
|
}
|