Full web : fichiers restants
This commit is contained in:
1 parent
ec3b7c9a01
commit
4826fa5b82
26 files changed
+2537
-793
No files matched your search
@@ -14,17 +14,23 @@ import (
|
||||
"pve-confsync/internal/pve/pvetest"
|
||||
)
|
||||
|
||||
// client connects to a fake cluster like the web UI does: API as root@pam,
|
||||
// pinned certificate, SSH with the pinned host key.
|
||||
func client(t *testing.T, s *pvetest.Server, name string) *pve.Client {
|
||||
t.Helper()
|
||||
sum := sha256.Sum256(s.Certificate().Raw)
|
||||
c, err := pve.New(pve.Options{Name: name, BaseURL: s.URL, TokenID: "confsync@pve!t", TokenSecret: "secret",
|
||||
Fingerprint: hex.EncodeToString(sum[:])})
|
||||
host, port := s.SSHAddr()
|
||||
c, err := config.Cluster{Name: name, URL: s.URL, User: "root@pam", Password: pvetest.Password,
|
||||
Fingerprint: hex.EncodeToString(sum[:]), SSHHost: host, SSHPort: port, SSHHostKey: s.SSHHostKey()}.PVE()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
// sdnKinds: the kinds of the SDN and datacenter tests.
|
||||
var sdnKinds = []model.Kind{model.KindDatacenter, model.KindZone, model.KindVNet, model.KindSubnet}
|
||||
|
||||
// reference: two zones (vlan, vxlan), one unsupported (evpn), vnets, subnets, tags.
|
||||
func reference(t *testing.T) *pvetest.Server {
|
||||
ref := pvetest.New("9.1.4")
|
||||
@@ -49,7 +55,7 @@ func reference(t *testing.T) *pvetest.Server {
|
||||
|
||||
func testConfig() *config.Config {
|
||||
return &config.Config{
|
||||
Kinds: model.Kinds,
|
||||
Kinds: sdnKinds,
|
||||
Clients: []config.Client{{
|
||||
Cluster: config.Cluster{Name: "site-a"},
|
||||
Mapping: map[model.Kind]map[string]map[string]any{
|
||||
|
||||
Reference in new issue
Block a user