mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-26 17:11:19 +02:00
This moves to performing installs via a container. Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
39 lines
1.0 KiB
Go
39 lines
1.0 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/. */
|
|
|
|
package manifest
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
"github.com/talos-systems/talos/pkg/userdata"
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
type validateSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
func TestValidateSuite(t *testing.T) {
|
|
suite.Run(t, new(validateSuite))
|
|
}
|
|
|
|
func (suite *validateSuite) TestVerifyDevice() {
|
|
// Start off with success and then remove bits
|
|
data := &userdata.UserData{}
|
|
err := yaml.Unmarshal([]byte(testConfig), data)
|
|
suite.Require().NoError(err)
|
|
|
|
suite.Require().NoError(VerifyBootDevice(data))
|
|
suite.Require().NoError(VerifyDataDevice(data))
|
|
|
|
// No impact because we can infer all data from the data device and
|
|
// defaults.
|
|
data.Install.Bootloader = true
|
|
suite.Require().NoError(VerifyBootDevice(data))
|
|
data.Install.Disk = "/dev/sda"
|
|
suite.Require().NoError(VerifyDataDevice(data))
|
|
}
|