8000 connect_with_defaults incl. tests by fussybeaver · Pull Request #373 · fussybeaver/bollard · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

connect_with_defaults incl. tests #373

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

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- run: docker run --rm --volumes-from certs --privileged --rm --entrypoint=chmod docker:stable-dind 644 /certs/key.pem /certs/ca-key.pem
- run: docker build -t bollard .
- run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='tcp://test.example.com:2376' --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features test_ssl,webpki -- --test test_version_ssl
- run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='tcp://test.example.com:2376' -e DOCKER_TLS_VERIFY=1 --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features webpki -- --test test_connect_with_defaults
- run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='https://test.example.com:2376' --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features webpki -- --test test_connect_with_defaults
test_http:
docker:
- image: docker:24.0.5
Expand All @@ -22,6 +24,7 @@ jobs:
- run: docker run -e DOCKER_TLS_CERTDIR="" --rm -h test.example.com -d --privileged --name test-docker-daemon docker:stable-dind --storage-driver=overlay
- run: docker build -t bollard .
- run: docker run -ti -e DOCKER_HOST='tcp://test.example.com:2375' --rm --link test-docker-daemon:docker bollard cargo test --features test_http -- --test test_version_http
- run: docker run -ti -e DOCKER_HOST='tcp://test.example.com:2375' --rm --link test-docker-daemon:docker bollard cargo test -- --test test_connect_with_defaults
test_unix:
docker:
- image: docker:24.0.5
Expand All @@ -30,6 +33,7 @@ jobs:
- setup_remote_docker
- run: docker build -t bollard .
- run: resources/dockerfiles/bin/run_integration_tests.sh --tests
- run: docker run -ti -e DOCKER_HOST='unix:///var/run/docker.sock' -v /var/run/docker.sock:/var/run/docker.sock --rm bollard cargo test -- --test test_connect_with_defaults
test_buildkit:
docker:
- image: docker:24.0.5
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ test_script:
- ps: Set-Item -path env:RUST_LOG -value "hyper=trace,bollard=debug"
- ps: Set-Item -path env:REGISTRY_HTTP_ADDR -value localhost:5000
- cargo test --verbose --tests -- --nocapture --test-threads 1
- ps: Set-Item -path env:DOCKER_HOST -value npipe:////./pipe/docker_engine
- cargo test --verbose --tests -- --nocapture --test-threads 1 --test test_connect_with_defaults
15 changes: 15 additions & 0 deletions tests/version_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,18 @@ fn test_downversioning() {
};
rt.block_on(fut);
}

#[test]
#[allow(clippy::redundant_closure_call)]
fn test_connect_with_defaults() {
#[cfg(unix)]
rt_exec!(
Docker::connect_with_defaults().unwrap().version(),
|version: Version| assert_eq!(version.os.unwrap(), "linux")
);
#[cfg(windows)]
rt_exec!(
Docker::connect_with_defaults().unwrap().version(),
|version: Version| assert_eq!(version.os.unwrap(), "windows")
)
}
0