aboutsummaryrefslogtreecommitdiff
path: root/pkg/systemdgen/systemdgen_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-14 15:47:23 +0100
committerGitHub <noreply@github.com>2020-01-14 15:47:23 +0100
commit564bd693cae4e8a870be7a7860ef673e793f6358 (patch)
treeab395cdeab8814c2d3b426cf5215246057ff87ba /pkg/systemdgen/systemdgen_test.go
parent3961882ffe9e1cb83adab483caf39a0db5b4430a (diff)
parent460887edca95605ee203893448d98986a2521e2d (diff)
downloadpodman-564bd693cae4e8a870be7a7860ef673e793f6358.tar.gz
podman-564bd693cae4e8a870be7a7860ef673e793f6358.tar.bz2
podman-564bd693cae4e8a870be7a7860ef673e793f6358.zip
Merge pull request #4858 from vrothberg/enable-linters
make lint: extend checks
Diffstat (limited to 'pkg/systemdgen/systemdgen_test.go')
-rw-r--r--pkg/systemdgen/systemdgen_test.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/pkg/systemdgen/systemdgen_test.go b/pkg/systemdgen/systemdgen_test.go
index e1da7e8e0..3894a0205 100644
--- a/pkg/systemdgen/systemdgen_test.go
+++ b/pkg/systemdgen/systemdgen_test.go
@@ -24,9 +24,10 @@ func TestValidateRestartPolicy(t *testing.T) {
{"failblank", ContainerInfo{restart: ""}, true},
}
for _, tt := range tests {
+ test := tt
t.Run(tt.name, func(t *testing.T) {
- if err := validateRestartPolicy(tt.ContainerInfo.restart); (err != nil) != tt.wantErr {
- t.Errorf("ValidateRestartPolicy() error = %v, wantErr %v", err, tt.wantErr)
+ if err := validateRestartPolicy(test.ContainerInfo.restart); (err != nil) != test.wantErr {
+ t.Errorf("ValidateRestartPolicy() error = %v, wantErr %v", err, test.wantErr)
}
})
}
@@ -221,18 +222,19 @@ WantedBy=multi-user.target`
},
}
for _, tt := range tests {
+ test := tt
t.Run(tt.name, func(t *testing.T) {
opts := Options{
Files: false,
- New: tt.info.New,
+ New: test.info.New,
}
- got, err := CreateContainerSystemdUnit(&tt.info, opts)
- if (err != nil) != tt.wantErr {
- t.Errorf("CreateContainerSystemdUnit() error = \n%v, wantErr \n%v", err, tt.wantErr)
+ got, err := CreateContainerSystemdUnit(&test.info, opts)
+ if (err != nil) != test.wantErr {
+ t.Errorf("CreateContainerSystemdUnit() error = \n%v, wantErr \n%v", err, test.wantErr)
return
}
- if got != tt.want {
- t.Errorf("CreateContainerSystemdUnit() = \n%v\n---------> want\n%v", got, tt.want)
+ if got != test.want {
+ t.Errorf("CreateContainerSystemdUnit() = \n%v\n---------> want\n%v", got, test.want)
}
})
}