-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! [OPS-1463] Docker networks and volumes
- Loading branch information
Showing
4 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,44 @@ | ||
# SPDX-FileCopyrightText: 2023 Serokell <https://serokell.io/> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
{ self, nixpkgs, pkgs, ... }: | ||
import "${nixpkgs}/nixos/tests/make-test-python.nix" ({...} : { | ||
name = "docker"; | ||
nodes = { | ||
docker = {...}: | ||
{ | ||
imports = [ self.nixosModules.docker ]; | ||
virtualisation.docker = { | ||
enable = true; | ||
volumes = [ "thevolume" ]; | ||
networks.thenetwork = { | ||
driver = "bridge"; | ||
subnet = "172.28.0.0/16"; | ||
ip-range = "172.28.5.0/24"; | ||
gateway = "172.28.5.254"; | ||
}; | ||
}; | ||
|
||
}; | ||
}; | ||
|
||
testScript = '' | ||
start_all() | ||
docker.wait_for_unit("sockets.target") | ||
docker.wait_for_unit("docker.service") | ||
docker.succeed("docker volume ls | grep thevolume") | ||
docker.succeed("docker network ls | grep thenetwork") | ||
docker.succeed("docker volume create newvolume"); | ||
docker.succeed("docker network create newnetwork") | ||
docker.systemctl("restart docker") | ||
docker.wait_for_unit("docker.service") | ||
# don't remove manually created networks and volumes | ||
docker.succeed("docker volume ls | grep newvolume") | ||
docker.succeed("docker network ls | grep newnetwork") | ||
''; | ||
}) { inherit pkgs; } |