Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integ-cli: remove ICMP dependency from test, use nslookup #11310

Merged
merged 1 commit into from
Mar 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,17 @@ func TestRunLeakyFileDescriptors(t *testing.T) {
logDone("run - check file descriptor leakage")
}

// it should be possible to ping Google DNS resolver
// it should be possible to lookup Google DNS
// this will fail when Internet access is unavailable
func TestRunPingGoogle(t *testing.T) {
func TestRunLookupGoogleDns(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really minor issue, but Dns should be DNS here.

My source is that the Docker coding style document says:

  1. All code should follow the guidelines covered in Effective Go and Go Code Review Comments.

Which has a section on initialisms at https://github.com/golang/go/wiki/CodeReviewComments#initialisms:

Words in names that are initialisms or acronyms (e.g. "URL" or "NATO") have a consistent case. For example, "URL" should appear as "URL" or "url" (as in "urlPony", or "URLPony"), never as "Url". Here's an example: ServeHTTP not ServeHttp.

Though I can see this file has multiple other instances of Dns instead of DNS, so this is probably a wide spread issue that is best addressed at scale.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shurcooL If you want to contribute and open a PR to update, please do! 👍

defer deleteAllContainers()

runCmd := exec.Command(dockerBinary, "run", "busybox", "ping", "-c", "1", "8.8.8.8")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
out, _, _, err := runCommandWithStdoutStderr(exec.Command(dockerBinary, "run", "busybox", "nslookup", "google.com"))
if err != nil {
t.Fatalf("failed to run container: %v, output: %q", err, out)
}

logDone("run - ping 8.8.8.8")
logDone("run - nslookup google.com")
}

// the exit code should be 0
Expand Down