]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/sync_sync_test.go
Update copyright years
[safcm/safcm.git] / cmd / safcm / sync_sync_test.go
index 40c5c556eccd5961513abe52c4671ed467a6b7db..2214e0ebfa98ebabd473c452d61a3ff3e8a239e2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021  Simon Ruderich
+// Copyright (C) 2021-2022  Simon Ruderich
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ func TestHostSyncReq(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
-       defer os.Chdir(cwd)
+       defer os.Chdir(cwd) //nolint:errcheck
 
        tests := []struct {
                name      string
@@ -62,7 +62,7 @@ func TestHostSyncReq(t *testing.T) {
                                        "host1.example.org",
                                },
                                Files: map[string]*safcm.File{
-                                       "/": &safcm.File{Path: "/",
+                                       "/": {Path: "/",
                                                OrigGroup: "group",
                                                Mode:      fs.ModeDir | 0755 | fs.ModeSetgid,
                                                Uid:       -1,
@@ -71,14 +71,14 @@ func TestHostSyncReq(t *testing.T) {
                                                        "touch /.update",
                                                },
                                        },
-                                       "/etc": &safcm.File{
+                                       "/etc": {
                                                OrigGroup: "group",
                                                Path:      "/etc",
                                                Mode:      fs.ModeDir | 0755,
                                                Uid:       -1,
                                                Gid:       -1,
                                        },
-                                       "/etc/.hidden": &safcm.File{
+                                       "/etc/.hidden": {
                                                OrigGroup: "group",
                                                Path:      "/etc/.hidden",
                                                Mode:      0100 | fs.ModeSetuid | fs.ModeSetgid | fs.ModeSticky,
@@ -86,7 +86,7 @@ func TestHostSyncReq(t *testing.T) {
                                                Gid:       -1,
                                                Data:      []byte("..."),
                                        },
-                                       "/etc/motd": &safcm.File{
+                                       "/etc/motd": {
                                                OrigGroup: "group",
                                                Path:      "/etc/motd",
                                                Mode:      0644,
@@ -94,7 +94,7 @@ func TestHostSyncReq(t *testing.T) {
                                                Gid:       -1,
                                                Data:      []byte("Welcome to Host ONE\n\n\n\n\n\nall\n\n\nhost1.example.org\n\n\n\n"),
                                        },
-                                       "/etc/rc.local": &safcm.File{
+                                       "/etc/rc.local": {
                                                OrigGroup: "group",
                                                Path:      "/etc/rc.local",
                                                Mode:      0700,
@@ -105,7 +105,7 @@ func TestHostSyncReq(t *testing.T) {
                                                        "/etc/rc.local",
                                                },
                                        },
-                                       "/etc/resolv.conf": &safcm.File{
+                                       "/etc/resolv.conf": {
                                                OrigGroup: "group",
                                                Path:      "/etc/resolv.conf",
                                                Mode:      0641,
@@ -118,7 +118,7 @@ func TestHostSyncReq(t *testing.T) {
                                                        "echo resolv.conf updated",
                                                },
                                        },
-                                       "/etc/test": &safcm.File{
+                                       "/etc/test": {
                                                OrigGroup: "group",
                                                Path:      "/etc/test",
                                                Mode:      os.ModeSymlink | 0777,