mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 22:34:56 -04:00
ci: add e2e test for constellation recover (#845)
* AB#2256 Add recover e2e test * AB#2256 move test & fix minor objections * AB#2256 fix path * AB#2256 rename hacky filename
This commit is contained in:
parent
2cee7cb454
commit
ae2db08f3a
14 changed files with 202 additions and 32 deletions
|
@ -214,6 +214,9 @@ func TestCreateCluster(t *testing.T) {
|
|||
"initSecret": {
|
||||
Value: "initSecret",
|
||||
},
|
||||
"uid": {
|
||||
Value: "12345abc",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -300,6 +303,34 @@ func TestCreateCluster(t *testing.T) {
|
|||
fs: afero.NewMemMapFs(),
|
||||
wantErr: true,
|
||||
},
|
||||
"no uid": {
|
||||
pathBase: "terraform",
|
||||
provider: cloudprovider.QEMU,
|
||||
vars: qemuVars,
|
||||
tf: &stubTerraform{
|
||||
showState: &tfjson.State{
|
||||
Values: &tfjson.StateValues{
|
||||
Outputs: map[string]*tfjson.StateOutput{},
|
||||
},
|
||||
},
|
||||
},
|
||||
fs: afero.NewMemMapFs(),
|
||||
wantErr: true,
|
||||
},
|
||||
"uid has wrong type": {
|
||||
pathBase: "terraform",
|
||||
provider: cloudprovider.QEMU,
|
||||
vars: qemuVars,
|
||||
tf: &stubTerraform{
|
||||
showState: &tfjson.State{
|
||||
Values: &tfjson.StateValues{
|
||||
Outputs: map[string]*tfjson.StateOutput{"uid": {Value: 42}},
|
||||
},
|
||||
},
|
||||
},
|
||||
fs: afero.NewMemMapFs(),
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
|
@ -315,15 +346,16 @@ func TestCreateCluster(t *testing.T) {
|
|||
|
||||
path := path.Join(tc.pathBase, strings.ToLower(tc.provider.String()))
|
||||
require.NoError(c.PrepareWorkspace(path, tc.vars))
|
||||
ip, initSecret, err := c.CreateCluster(context.Background())
|
||||
tfOutput, err := c.CreateCluster(context.Background())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
}
|
||||
assert.NoError(err)
|
||||
assert.Equal("192.0.2.100", ip)
|
||||
assert.Equal("initSecret", initSecret)
|
||||
assert.Equal("192.0.2.100", tfOutput.IP)
|
||||
assert.Equal("initSecret", tfOutput.Secret)
|
||||
assert.Equal("12345abc", tfOutput.UID)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue