Skip to content

Commit 0951079

Browse files
authored
Merge pull request #4801 from haytok/delete-chains-on-nat-table
test: remove a new line from containerID for correct test execution
2 parents b8fae3b + 46ca11d commit 0951079

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/nerdctl/container/container_remove_linux_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package container
1919
import (
2020
"fmt"
2121
"strconv"
22+
"strings"
2223
"testing"
2324
"time"
2425

@@ -93,7 +94,7 @@ func TestContainerRmIptables(t *testing.T) {
9394

9495
// Create a container with port mapping to ensure iptables rules are created
9596
containerID := helpers.Capture("run", "-d", "--name", data.Identifier(), "-p", fmt.Sprintf("%d:80", port), testutil.NginxAlpineImage)
96-
data.Labels().Set("containerID", containerID)
97+
data.Labels().Set("containerID", strings.TrimSpace(containerID))
9798
nerdtest.EnsureContainerStarted(helpers, data.Identifier())
9899
},
99100
Cleanup: func(data test.Data, helpers test.Helpers) {

0 commit comments

Comments
 (0)