-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9951 from hashicorp/b-8284
drivers/docker: support mapping multiple host ports to the same container port
- Loading branch information
Showing
5 changed files
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package docker | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/hashicorp/nomad/helper/testlog" | ||
) | ||
|
||
func TestPublishedPorts_add(t *testing.T) { | ||
p := newPublishedPorts(testlog.HCLogger(t)) | ||
p.add("label", "10.0.0.1", 1234, 80) | ||
p.add("label", "10.0.0.1", 5678, 80) | ||
for _, bindings := range p.publishedPorts { | ||
require.Len(t, bindings, 2) | ||
} | ||
require.Len(t, p.exposedPorts, 2) | ||
} |