forked from toolshed/abra
feat: adds running integrations test suite
This commit is contained in:
@@ -100,6 +100,8 @@ vm-client-stop:
|
||||
sudo systemctl stop microvm@$(CLIENT_VM)
|
||||
vm-client-delete: vm-client-stop
|
||||
sudo rm -rf /var/lib/microvms/$(CLIENT_VM)
|
||||
vm-client-connect:
|
||||
kitten ssh abra@10.0.0.2 -i ./tests/resources/local_integration_ssh
|
||||
|
||||
SERVER_VM := abra-server
|
||||
vm-server-status:
|
||||
@@ -114,8 +116,14 @@ vm-server-run:
|
||||
sudo microvm -f git+file://$$(pwd) -r $(SERVER_VM)
|
||||
vm-server-stop:
|
||||
sudo systemctl stop microvm@$(SERVER_VM)
|
||||
vm-server-delete: vm-stop
|
||||
vm-server-delete: vm-server-stop
|
||||
sudo rm -rf /var/lib/microvms/$(SERVER_VM)
|
||||
vm-server-connect:
|
||||
ssh abra@10.0.0.3 -i ./tests/resources/local_integration_ssh
|
||||
|
||||
test-integration:
|
||||
ssh-keygen -t ed25519 -f ./test-integration -q -N "" -C "abra integration test"
|
||||
ssh-add ./tests/resources/local_integration_ssh
|
||||
./abra server add abra.local
|
||||
./abra app new traefik
|
||||
./abra app deploy traefik.abra.local
|
||||
@bats -Tp tests/integration --verbose-run
|
||||
|
||||
@@ -25,8 +25,18 @@
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
publicKey = builtins.readFile ./test-integration.pub;
|
||||
privateKey = builtins.readFile ./test-integration;
|
||||
publicKey = builtins.readFile ./tests/resources/local_integration_ssh.pub;
|
||||
privateKey = builtins.readFile ./tests/resources/local_integration_ssh;
|
||||
localDomainHosts = builtins.readFile ./tests/resources/local_hosts;
|
||||
username = "abra";
|
||||
password = "abra";
|
||||
defaultDNS = [
|
||||
# Quad9.net
|
||||
"9.9.9.9"
|
||||
"149.112.112.112"
|
||||
"2620:fe::fe"
|
||||
"2620:fe::9"
|
||||
];
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
@@ -37,7 +47,16 @@
|
||||
home-manager.nixosModules.home-manager
|
||||
./nix/hosts/client/configuration.nix
|
||||
];
|
||||
specialArgs = { inherit publicKey privateKey; };
|
||||
specialArgs = {
|
||||
inherit
|
||||
publicKey
|
||||
privateKey
|
||||
username
|
||||
password
|
||||
defaultDNS
|
||||
localDomainHosts
|
||||
;
|
||||
};
|
||||
};
|
||||
abra-server = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
@@ -45,11 +64,20 @@
|
||||
microvm.nixosModules.microvm
|
||||
./nix/hosts/server/configuration.nix
|
||||
];
|
||||
specialArgs = { inherit publicKey privateKey; };
|
||||
specialArgs = {
|
||||
inherit
|
||||
publicKey
|
||||
privateKey
|
||||
username
|
||||
password
|
||||
defaultDNS
|
||||
localDomainHosts
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
packages = rec {
|
||||
abra = pkgs.callPackage ./package.nix { };
|
||||
abra = pkgs.callPackage ./nix/package.nix { };
|
||||
default = abra;
|
||||
};
|
||||
apps = rec {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
pkgs,
|
||||
publicKey,
|
||||
privateKey,
|
||||
username,
|
||||
defaultDNS,
|
||||
localDomainHosts,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -11,6 +14,12 @@ let
|
||||
serverIp = "10.0.0.3";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../modules/ssh.nix
|
||||
../../modules/user.nix
|
||||
../../modules/docker.nix
|
||||
];
|
||||
|
||||
microvm = {
|
||||
vcpu = 4;
|
||||
mem = 2049; # see issue related in microvm repo with 2048, so add 1MB
|
||||
@@ -27,8 +36,8 @@ in
|
||||
tag = "repo";
|
||||
# Source path can be absolute or relative
|
||||
# to /var/lib/microvms/$hostName
|
||||
source = "/home/dev/Documents/abra";
|
||||
mountPoint = "/home/dev/abra";
|
||||
source = "/home/dev/Documents/kum/abra";
|
||||
mountPoint = "/home/${username}/abra";
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -77,13 +86,7 @@ in
|
||||
networkConfig = {
|
||||
# DNS servers no longer come from DHCP nor Router
|
||||
# Advertisements. Perhaps you want to change the defaults:
|
||||
DNS = [
|
||||
# Quad9.net
|
||||
"9.9.9.9"
|
||||
"149.112.112.112"
|
||||
"2620:fe::fe"
|
||||
"2620:fe::9"
|
||||
];
|
||||
DNS = defaultDNS;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -91,10 +94,7 @@ in
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
networking.firewall.allowedUDPPorts = [ 22 ];
|
||||
|
||||
networking.extraHosts = ''
|
||||
${serverIp} abra.local
|
||||
${serverIp} app_check_bats.abra.local
|
||||
'';
|
||||
networking.extraHosts = localDomainHosts;
|
||||
|
||||
environment.variables = {
|
||||
CGO_ENABLED = 0;
|
||||
@@ -102,32 +102,26 @@ in
|
||||
ABRA_DIR = "$HOME/.abra_test";
|
||||
};
|
||||
|
||||
users.users.dev = {
|
||||
isNormalUser = true;
|
||||
password = "test";
|
||||
home = "/home/dev";
|
||||
description = "Alice Foobar";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
publicKey
|
||||
];
|
||||
};
|
||||
# ssh agent with askpass
|
||||
programs.ssh = {
|
||||
startAgent = true;
|
||||
knownHostsFiles = [
|
||||
(pkgs.writeText "local.keys" ''
|
||||
abra.local ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFD3rtSHGYWSrvVZe9VGQSa16EIawScFWmkBfGC0cebv
|
||||
'')
|
||||
];
|
||||
};
|
||||
services.openssh = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = [ "dev" ];
|
||||
};
|
||||
# many recipe commands need a preset git user
|
||||
config = [
|
||||
{
|
||||
user = {
|
||||
name = "abra dev";
|
||||
email = "helo@coopcloud.tech";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
programs.git.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# build dependencies, copied from flake.nix
|
||||
@@ -140,12 +134,13 @@ in
|
||||
p.bats-support
|
||||
]))
|
||||
jq
|
||||
wget
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.dev =
|
||||
users."${username}" =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
@@ -157,6 +152,7 @@ in
|
||||
publicKey = publicKey;
|
||||
privateKey = privateKey;
|
||||
serverIp = serverIp;
|
||||
username = username;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{
|
||||
serverIp,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "dev";
|
||||
home.homeDirectory = "/home/dev";
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
@@ -26,15 +27,15 @@
|
||||
settings = {
|
||||
"abra.local" = {
|
||||
HostName = serverIp;
|
||||
User = "dev";
|
||||
User = username;
|
||||
Port = 22;
|
||||
IdentityFile = "/home/dev/abra/test-integration";
|
||||
IdentityFile = "/home/${username}/abra/tests/resources/local_integration_ssh";
|
||||
};
|
||||
"*.abra.local" = {
|
||||
HostName = serverIp;
|
||||
User = "dev";
|
||||
User = username;
|
||||
Port = 22;
|
||||
IdentityFile = "/home/dev/abra/test-integration";
|
||||
IdentityFile = "/home/${username}/abra/tests/resources/local_integration_sshn";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
publicKey,
|
||||
defaultDNS,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -9,9 +9,15 @@ let
|
||||
clientIp = "10.0.0.2";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../modules/ssh.nix
|
||||
../../modules/user.nix
|
||||
../../modules/docker.nix
|
||||
];
|
||||
|
||||
microvm = {
|
||||
vcpu = 2;
|
||||
mem = 2049; # see issue related in microvm repo with 2048, so add 1MB
|
||||
vcpu = 4;
|
||||
mem = 8097; # see issue related in microvm repo with 2048, so add 1MB
|
||||
interfaces = [
|
||||
{
|
||||
id = "vm${toString index}";
|
||||
@@ -23,7 +29,7 @@ in
|
||||
|
||||
boot.tmp = {
|
||||
useTmpfs = true;
|
||||
tmpfsSize = "2G";
|
||||
tmpfsSize = "8G";
|
||||
};
|
||||
|
||||
networking = {
|
||||
@@ -65,13 +71,7 @@ in
|
||||
networkConfig = {
|
||||
# DNS servers no longer come from DHCP nor Router
|
||||
# Advertisements. Perhaps you want to change the defaults:
|
||||
DNS = [
|
||||
# Quad9.net
|
||||
"9.9.9.9"
|
||||
"149.112.112.112"
|
||||
"2620:fe::fe"
|
||||
"2620:fe::9"
|
||||
];
|
||||
DNS = defaultDNS;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -80,37 +80,12 @@ in
|
||||
22
|
||||
80
|
||||
443
|
||||
1312 # deploy with udp and tcp on same port test
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
22
|
||||
80
|
||||
443
|
||||
1312 # deploy with udp and tcp on same port test
|
||||
];
|
||||
|
||||
users.users.dev = {
|
||||
isNormalUser = true;
|
||||
password = "test";
|
||||
home = "/home/dev";
|
||||
description = "Alice Foobar";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"docker"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
publicKey
|
||||
];
|
||||
};
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = [ "dev" ];
|
||||
};
|
||||
};
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
liveRestore = false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
liveRestore = false;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
privateKey,
|
||||
publicKey,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# default host key location
|
||||
environment.etc."ssh/ssh_host_ed25519_key" = {
|
||||
text = privateKey;
|
||||
mode = "0600";
|
||||
};
|
||||
environment.etc."ssh/ssh_host_ed25519_key.pub" = {
|
||||
text = publicKey;
|
||||
mode = "0644";
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = [ "${username}" ];
|
||||
};
|
||||
generateHostKeys = false;
|
||||
hostKeys = [
|
||||
{
|
||||
path = "/etc/ssh/ssh_host_ed25519_key";
|
||||
type = "ed25519";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
username,
|
||||
password,
|
||||
publicKey,
|
||||
...
|
||||
}:
|
||||
{
|
||||
users.users."${username}" = {
|
||||
isNormalUser = true;
|
||||
password = password;
|
||||
home = "/home/${username}";
|
||||
description = "Abra server user";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"docker"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
publicKey
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -598,8 +598,7 @@ teardown(){
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input
|
||||
assert_success
|
||||
|
||||
run docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' \
|
||||
$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)
|
||||
_inspect
|
||||
assert_success
|
||||
assert_output --partial "WITH_COMMENT=foo"
|
||||
|
||||
@@ -610,14 +609,13 @@ teardown(){
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --force
|
||||
assert_success
|
||||
|
||||
run docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' \
|
||||
$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)
|
||||
_inspect
|
||||
assert_success
|
||||
refute_output --partial "WITH_COMMENT=foo"
|
||||
assert_output --partial "WITH_COMMENT=bar"
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
# bats test_tags=slow,error
|
||||
@test "deploy with udp and tcp on same port" {
|
||||
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/p4u1\/abra-test-recipe:030e8a1cb1a0f17281847b3e55d829220ad32c50/g' \
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||
@@ -629,8 +627,14 @@ teardown(){
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input
|
||||
assert_success
|
||||
|
||||
run docker service inspect --format '{{ range .Endpoint.Ports }}{{ .Protocol }}={{ .PublishedPort }}{{ end }}' \
|
||||
if _is_local;
|
||||
then
|
||||
run docker service inspect --format "{{ range .Endpoint.Ports }}{{ .Protocol }}={{ .PublishedPort }}{{ end }}" \
|
||||
"${TEST_APP_DOMAIN//./_}_app"
|
||||
else
|
||||
run ssh "$TEST_SERVER" "docker service inspect --format '{{ range .Endpoint.Ports }}{{ .Protocol }}={{ .PublishedPort }}{{ end }}' ${TEST_APP_DOMAIN//./_}_app"
|
||||
fi
|
||||
|
||||
assert_success
|
||||
assert_output --partial "tcp=1312"
|
||||
assert_output --partial "udp=1312"
|
||||
@@ -671,6 +675,9 @@ teardown(){
|
||||
@test "unable to deploy borked tag" {
|
||||
_remove_tags
|
||||
|
||||
# can not tag without it
|
||||
_set_git_author
|
||||
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag \
|
||||
-a "2.4.8_1" -m "feat: completely borked tag"
|
||||
assert_success
|
||||
|
||||
@@ -133,8 +133,7 @@ teardown(){
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" --no-input
|
||||
assert_success
|
||||
|
||||
run docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' \
|
||||
$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)
|
||||
_inspect
|
||||
assert_success
|
||||
assert_output --partial "$TEST_RECIIPE:0.1.0+1.20.0"
|
||||
}
|
||||
|
||||
@@ -140,15 +140,22 @@ teardown(){
|
||||
_undeploy_app
|
||||
|
||||
sanitisedDomainName="${TEST_APP_DOMAIN//./_}"
|
||||
run docker config create "${sanitisedDomainName}_test_conf_v99" "$ABRA_DIR/recipes/abra-test-recipe/abra.sh"
|
||||
assert_success
|
||||
remote_execute=""
|
||||
if _is_local;
|
||||
then
|
||||
run docker config create "${sanitisedDomainName}_test_conf_v99" "$ABRA_DIR/recipes/abra-test-recipe/abra.sh"
|
||||
else
|
||||
remote_execute="ssh '$TEST_SERVER'"
|
||||
run cat "$ABRA_DIR/recipes/abra-test-recipe/abra.sh" | ssh "$TEST_SERVER" docker config create "${sanitisedDomainName}_test_conf_v99 -"
|
||||
assert_success
|
||||
fi
|
||||
|
||||
assert bash -c "docker config ls | grep -q test_conf_v99"
|
||||
assert bash -c "$remote_execute docker config ls | grep -q test_conf_v99"
|
||||
|
||||
run $ABRA app rm "$TEST_APP_DOMAIN" --no-input
|
||||
assert_success
|
||||
|
||||
refute bash -c "docker config ls | grep -q test_conf_v99"
|
||||
refute bash -c "$remote_execute docker config ls | grep -q test_conf_v99"
|
||||
}
|
||||
|
||||
@test "remove .env file" {
|
||||
|
||||
@@ -54,8 +54,7 @@ teardown(){
|
||||
--no-input
|
||||
assert_success
|
||||
|
||||
run docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' \
|
||||
$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)
|
||||
_inspect
|
||||
assert_success
|
||||
assert_output --partial "$TEST_RECIIPE:0.1.0+1.20.0"
|
||||
}
|
||||
|
||||
@@ -53,8 +53,7 @@ teardown(){
|
||||
run $ABRA app upgrade "$TEST_APP_DOMAIN" "0.2.0+1.21.0" --no-input
|
||||
assert_success
|
||||
|
||||
run docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' \
|
||||
$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)
|
||||
_inspect
|
||||
assert_success
|
||||
assert_output --partial "$TEST_RECIIPE:0.2.0+1.21.0"
|
||||
assert_output --partial "$TEST_RECIPE:0.2.0+1.21.0"
|
||||
}
|
||||
|
||||
@@ -31,9 +31,18 @@ _ensure_ssh_agent() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
|
||||
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
|
||||
eval `ssh-agent`
|
||||
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
||||
# export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
|
||||
# if [ ! -S ~/.ssh/ssh_auth_sock ]; then
|
||||
# eval `ssh-agent`
|
||||
# ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
|
||||
# fi
|
||||
}
|
||||
|
||||
_is_local() {
|
||||
if [[ "$TEST_SERVER" == "default" ]];
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
_ensure_swarm() {
|
||||
if [ "$(docker info | grep Swarm | sed 's/Swarm: //g' | tr -d ' ')" == "inactive" ]; then
|
||||
run docker swarm init --advertise-addr 127.0.0.1:2377
|
||||
assert_success
|
||||
if [ "$(docker info | grep Swarm | sed 's/Swarm: //g' | tr -d ' ')" == "inactive" ]; then
|
||||
run docker swarm init --advertise-addr 127.0.0.1:2377
|
||||
assert_success
|
||||
fi
|
||||
|
||||
if ! $(docker network ls | grep -q 'proxy'); then
|
||||
run docker network create -d overlay proxy
|
||||
assert_success
|
||||
if ! docker network ls | grep -q 'proxy'; then
|
||||
run docker network create -d overlay proxy
|
||||
assert_success
|
||||
fi
|
||||
|
||||
if ! _is_local;
|
||||
then
|
||||
if [ "$(ssh "$TEST_SERVER" docker info | grep Swarm | sed 's/Swarm: //g' | tr -d ' ')" == "inactive" ]; then
|
||||
run ssh "$TEST_SERVER" docker swarm init --advertise-addr 127.0.0.1:2377
|
||||
assert_success
|
||||
fi
|
||||
|
||||
if ! ssh "$TEST_SERVER" docker network ls | grep -q 'proxy'; then
|
||||
run ssh "$TEST_SERVER" docker network create -d overlay proxy
|
||||
assert_success
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_inspect() {
|
||||
if _is_local;
|
||||
then
|
||||
containerId="$(docker ps -f name="$TEST_APP_DOMAIN_$TEST_SERVER" -q)"
|
||||
run docker inspect "$containerId"
|
||||
else
|
||||
containerId="$(ssh "$TEST_SERVER" docker ps -f name="$TEST_APP_DOMAIN" -q)"
|
||||
run ssh "$TEST_SERVER" docker inspect "$containerId"
|
||||
fi
|
||||
}
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "generating hosts file..."
|
||||
|
||||
hosts_file_path="./tests/resources/local_hosts"
|
||||
|
||||
echo "removing old file..."
|
||||
rm $hosts_file_path
|
||||
|
||||
# default entries
|
||||
# the server
|
||||
echo "10.0.0.3 abra.local" >> $hosts_file_path
|
||||
# used to spin up traefik
|
||||
echo "10.0.0.3 traefik.abra.local" >> $hosts_file_path
|
||||
# used in integration tests
|
||||
echo "10.0.0.3 gitea.abra.local" >> $hosts_file_path
|
||||
echo "10.0.0.3 zammad.abra.local" >> $hosts_file_path
|
||||
echo "10.0.0.3 custom-html.abra.local" >> $hosts_file_path
|
||||
echo "10.0.0.3 foo.abra.local" >> $hosts_file_path
|
||||
echo "10.0.0.3 foobar.abra.local" >> $hosts_file_path
|
||||
|
||||
search_dir=./tests/integration
|
||||
for entry in "$search_dir"/*.bats
|
||||
do
|
||||
base_name=$(basename "${entry}")
|
||||
# converting file names to testing subdomains
|
||||
subdomain=$(echo "$base_name" | tr . _)
|
||||
echo "10.0.0.3 $subdomain.abra.local" >> $hosts_file_path
|
||||
done
|
||||
|
||||
echo "writing hosts success"
|
||||
@@ -38,8 +38,6 @@ teardown(){
|
||||
|
||||
run $ABRA recipe upgrade "custom-html" --no-input
|
||||
assert_success
|
||||
assert_output --partial 'can upgrade service: app'
|
||||
|
||||
assert_exists "$ABRA_DIR/recipes/custom-html"
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ teardown(){
|
||||
assert bash -c "docker context ls | grep -q $TEST_SERVER"
|
||||
|
||||
server_dir_perms=$(stat -c "%a" "$ABRA_DIR/servers/$TEST_SERVER")
|
||||
assert_equal $server_dir_perms "700"
|
||||
assert_equal "$server_dir_perms" "700"
|
||||
}
|
||||
|
||||
@test "error if using name and --local together" {
|
||||
@@ -43,8 +43,8 @@ teardown(){
|
||||
assert bash -c "docker context ls | grep -q default"
|
||||
assert_output --partial 'local server successfully added'
|
||||
|
||||
server_dir_perms=$(stat -c "%a" "$ABRA_DIR/servers/$TEST_SERVER")
|
||||
assert_equal $server_dir_perms "700"
|
||||
server_dir_perms=$(stat -c "%a" "$ABRA_DIR/servers/default")
|
||||
assert_equal "$server_dir_perms" "700"
|
||||
}
|
||||
|
||||
@test "create local server fails when no docker swarm" {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
10.0.0.3 abra.local
|
||||
10.0.0.3 traefik.abra.local
|
||||
10.0.0.3 gitea.abra.local
|
||||
10.0.0.3 zammad.abra.local
|
||||
10.0.0.3 custom-html.abra.local
|
||||
10.0.0.3 foo.abra.local
|
||||
10.0.0.3 foobar.abra.local
|
||||
10.0.0.3 app_check_bats.abra.local
|
||||
10.0.0.3 app_cmd_bats.abra.local
|
||||
10.0.0.3 app_config_bats.abra.local
|
||||
10.0.0.3 app_cp_bats.abra.local
|
||||
10.0.0.3 app_deploy_bats.abra.local
|
||||
10.0.0.3 app_deploy_env_version_bats.abra.local
|
||||
10.0.0.3 app_deploy_overview_bats.abra.local
|
||||
10.0.0.3 app_deploy_remote_recipes_bats.abra.local
|
||||
10.0.0.3 app_env_bats.abra.local
|
||||
10.0.0.3 app_env_version_bats.abra.local
|
||||
10.0.0.3 app_labels_bats.abra.local
|
||||
10.0.0.3 app_list_bats.abra.local
|
||||
10.0.0.3 app_logs_bats.abra.local
|
||||
10.0.0.3 app_move_bats.abra.local
|
||||
10.0.0.3 app_new_bats.abra.local
|
||||
10.0.0.3 app_ps_bats.abra.local
|
||||
10.0.0.3 app_remove_bats.abra.local
|
||||
10.0.0.3 app_restart_bats.abra.local
|
||||
10.0.0.3 app_rollback_bats.abra.local
|
||||
10.0.0.3 app_rollback_env_version_bats.abra.local
|
||||
10.0.0.3 app_rollback_overview_bats.abra.local
|
||||
10.0.0.3 app_run_bats.abra.local
|
||||
10.0.0.3 app_secret_bats.abra.local
|
||||
10.0.0.3 app_secret_env_version_bats.abra.local
|
||||
10.0.0.3 app_services_bats.abra.local
|
||||
10.0.0.3 app_undeploy_bats.abra.local
|
||||
10.0.0.3 app_undeploy_env_version_bats.abra.local
|
||||
10.0.0.3 app_undeploy_overview_bats.abra.local
|
||||
10.0.0.3 app_upgrade_bats.abra.local
|
||||
10.0.0.3 app_upgrade_env_version_bats.abra.local
|
||||
10.0.0.3 app_upgrade_overview_bats.abra.local
|
||||
10.0.0.3 app_volume_bats.abra.local
|
||||
10.0.0.3 autocomplete_bats.abra.local
|
||||
10.0.0.3 catalogue_bats.abra.local
|
||||
10.0.0.3 dirs_bats.abra.local
|
||||
10.0.0.3 install_bats.abra.local
|
||||
10.0.0.3 recipe_diff_bats.abra.local
|
||||
10.0.0.3 recipe_fetch_bats.abra.local
|
||||
10.0.0.3 recipe_lint_bats.abra.local
|
||||
10.0.0.3 recipe_list_bats.abra.local
|
||||
10.0.0.3 recipe_new_bats.abra.local
|
||||
10.0.0.3 recipe_release_bats.abra.local
|
||||
10.0.0.3 recipe_reset_bats.abra.local
|
||||
10.0.0.3 recipe_upgrade_bats.abra.local
|
||||
10.0.0.3 recipe_version_bats.abra.local
|
||||
10.0.0.3 server_add_bats.abra.local
|
||||
10.0.0.3 server_list_bats.abra.local
|
||||
10.0.0.3 server_prune_bats.abra.local
|
||||
10.0.0.3 server_remove_bats.abra.local
|
||||
10.0.0.3 upgrade_bats.abra.local
|
||||
10.0.0.3 version_bats.abra.local
|
||||
@@ -0,0 +1,7 @@
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||
QyNTUxOQAAACBQ967UhxmFkq71WXvVRkEmtehCGsEnBVppAXxgtHHm7wAAAJhFGwTnRRsE
|
||||
5wAAAAtzc2gtZWQyNTUxOQAAACBQ967UhxmFkq71WXvVRkEmtehCGsEnBVppAXxgtHHm7w
|
||||
AAAEAnHEZcf2NeRQEcJC/aVgUWsdOz+vQgEG9ZY+3ErCeaKFD3rtSHGYWSrvVZe9VGQSa1
|
||||
6EIawScFWmkBfGC0cebvAAAAFWFicmEgaW50ZWdyYXRpb24gdGVzdA==
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFD3rtSHGYWSrvVZe9VGQSa16EIawScFWmkBfGC0cebv abra integration test
|
||||
Reference in New Issue
Block a user