forked from Telmate/proxmox-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cephfs.go
59 lines (53 loc) · 1.42 KB
/
cephfs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package storagesubtests
import (
"testing"
"github.com/Telmate/proxmox-api-go/proxmox"
)
var CephfsFull = proxmox.ConfigStorage{
Enable: true,
Nodes: []string{"pve"},
Type: "cephfs",
CephFS: &proxmox.ConfigStorageCephFS{
Monitors: []string{"10.20.1.1", "10.20.1.2"},
Username: "test-ceph-user",
FSname: "test-fs-name",
},
Content: &proxmox.ConfigStorageContent{
Backup: proxmox.PointerBool(true),
Iso: proxmox.PointerBool(true),
Snippets: proxmox.PointerBool(true),
Template: proxmox.PointerBool(true),
},
BackupRetention: &proxmox.ConfigStorageBackupRetention{
Last: proxmox.PointerInt(6),
Hourly: proxmox.PointerInt(5),
Daily: proxmox.PointerInt(4),
Monthly: proxmox.PointerInt(3),
Weekly: proxmox.PointerInt(2),
Yearly: proxmox.PointerInt(1),
},
}
var CephfsEmpty = proxmox.ConfigStorage{
Type: "cephfs",
CephFS: &proxmox.ConfigStorageCephFS{
Monitors: []string{"10.20.1.1"},
Username: "test-ceph-user",
FSname: "test-fs-name",
},
Content: &proxmox.ConfigStorageContent{
Iso: proxmox.PointerBool(true),
},
}
func CephfsGetFull(name string, t *testing.T) {
s := CloneJson(CephfsFull)
s.ID = name
Get(s, name, t)
}
func CephfsGetEmpty(name string, t *testing.T) {
s := CloneJson(CephfsEmpty)
s.ID = name
s.Content.Backup = proxmox.PointerBool(false)
s.Content.Snippets = proxmox.PointerBool(false)
s.Content.Template = proxmox.PointerBool(false)
Get(s, name, t)
}