X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_sync_test.go;h=889aa2f21ad0098e2c14e29f659ee23f5c05a6f6;hb=b833e6d877e00290146fcd1e75a533664cf2dcb7;hp=a5f65811e0d82297f642f01dcf027dd175ff9da3;hpb=20686d0d25d7d22f577fc80df31c192b6a88d318;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/sync_sync_test.go b/cmd/safcm/sync_sync_test.go index a5f6581..889aa2f 100644 --- a/cmd/safcm/sync_sync_test.go +++ b/cmd/safcm/sync_sync_test.go @@ -47,7 +47,7 @@ func TestHostSyncReq(t *testing.T) { }{ // NOTE: Also update MsgSyncReq in safcm-remote test cases - // when changing anything here! + // changing the MsgSyncReq struct! { "project: host1", @@ -149,7 +149,7 @@ func TestHostSyncReq(t *testing.T) { }, []string{ "host1.example.org: 3 host groups: all group group3 host1.example.org remove", - "host1.example.org: 3 host group priorities (desc. order): host1.example.org", + "host1.example.org: 3 host group priorities (descending): host1.example.org", }, nil, }, @@ -265,9 +265,9 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host1.example.org: 3 host groups: all dns host1.example.org", - "host1.example.org: 3 host group priorities (desc. order): host1.example.org", + "host1.example.org: 3 host group priorities (descending): host1.example.org", }, - fmt.Errorf("groups dns and all both provide file \"/etc/resolv.conf\"\nUse 'group_order' in config.yaml to declare preference"), + fmt.Errorf("groups dns and all both provide \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"), }, { "conflict: file from detected group", @@ -280,9 +280,9 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host2.example.org: 3 host groups: all detected_other host2.example.org other", - "host2.example.org: 3 host group priorities (desc. order): host2.example.org", + "host2.example.org: 3 host group priorities (descending): host2.example.org", }, - fmt.Errorf("groups other and all both provide file \"/etc/resolv.conf\"\nUse 'group_order' in config.yaml to declare preference"), + fmt.Errorf("groups other and all both provide \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"), }, { @@ -294,9 +294,9 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host1.example.org: 3 host groups: all dns host1.example.org", - "host1.example.org: 3 host group priorities (desc. order): host1.example.org", + "host1.example.org: 3 host group priorities (descending): host1.example.org", }, - fmt.Errorf("groups dns and all both provide file \"/etc\"\nUse 'group_order' in config.yaml to declare preference"), + fmt.Errorf("groups dns and all both provide \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"), }, { "conflict: dir from detected group", @@ -309,9 +309,9 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host2.example.org: 3 host groups: all detected_other host2.example.org other", - "host2.example.org: 3 host group priorities (desc. order): host2.example.org", + "host2.example.org: 3 host group priorities (descending): host2.example.org", }, - fmt.Errorf("groups other and all both provide file \"/etc\"\nUse 'group_order' in config.yaml to declare preference"), + fmt.Errorf("groups other and all both provide \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"), }, { @@ -326,8 +326,8 @@ func TestHostSyncReq(t *testing.T) { }, { - "group_order", - "project-group_order", + "group_priority", + "project-group_priority", "host1.example.org", nil, safcm.LogDebug3, @@ -422,7 +422,7 @@ func TestHostSyncReq(t *testing.T) { }, []string{ "host1.example.org: 3 host groups: all group-a group-b host1.example.org", - "host1.example.org: 3 host group priorities (desc. order): host1.example.org group-a group-b all", + "host1.example.org: 3 host group priorities (descending): host1.example.org group-a group-b all", `host1.example.org: 4 files: "/etc": group group-a overwrites triggers from group group-b`, `host1.example.org: 4 files: "/etc": group host1.example.org overwrites triggers from group group-a`, }, @@ -430,8 +430,8 @@ func TestHostSyncReq(t *testing.T) { }, { - "group_order (single group)", - "project-group_order-single", + "group_priority (single group)", + "project-group_priority-single", "host1.example.org", nil, safcm.LogDebug3, @@ -457,7 +457,7 @@ func TestHostSyncReq(t *testing.T) { }, []string{ "host1.example.org: 3 host groups: all group-a group-b host1.example.org", - "host1.example.org: 3 host group priorities (desc. order): host1.example.org group-a", + "host1.example.org: 3 host group priorities (descending): host1.example.org group-a", }, nil, }, @@ -515,7 +515,6 @@ func TestHostSyncReq(t *testing.T) { } res, err := s.hostSyncReq(tc.detected) - testutil.AssertEqual(t, "res", res, tc.exp) testutil.AssertErrorEqual(t, "err", err, tc.expErr)