Skip to content

Commit

Permalink
Make provisioning work under xenial
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Grutschus committed Sep 19, 2018
1 parent aa06c05 commit 4338c73
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "hashicorp/precise32"
config.vm.box = "ubuntu/xenial64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand All @@ -30,7 +30,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.post_up_message = <<MESSAGE
You can now run the integration tests with:
./vendor/bin/behat -c tests/behat.yml.dist
./vendor/bin/behat
MESSAGE

# Create a private network, which allows host-only access to the machine
Expand Down
6 changes: 3 additions & 3 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ default:
- Fabiang\Sasl\Behat\XmppContext:
- localhost
- 15222
- precise32
- ubuntu-xenial
- testuser
- testpass
- "%paths.base%/log/features/"
- "%paths.base%/tests/log/features/"
- Fabiang\Sasl\Behat\Pop3Context:
- localhost
- 11110
- testuser
- testpass
- "%paths.base%/log/features/"
- "%paths.base%/tests/log/features/"
testers:
strict: true
4 changes: 2 additions & 2 deletions tests/provisioner/install_dovecot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ if [ ! -f "$dovecot_configured" ]; then
dovecot_restart=1
fi

config_mail=$(grep '#mail_location =' "$dovecot_mail_config")
config_mail=$(grep '^mail_location = mbox:~/mail:INBOX=/var/mail/%u' "$dovecot_mail_config")
if [ -n "$config_mail" ]; then
sed -i 's/#mail_location =/mail_location = maildir:~\/Maildir/' "$dovecot_mail_config"
sed -i 's/^mail_location =/mail_location = maildir:~\/Maildir\n#mail_location =/' "$dovecot_mail_config"
dovecot_restart=1
fi

Expand Down
21 changes: 16 additions & 5 deletions tests/provisioner/install_ejabberd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [ -z `which ejabberdctl` ]; then
echo "done"
fi

ejabberd_config="/etc/ejabberd/ejabberd.cfg"
ejabberd_config="/etc/ejabberd/ejabberd.yml"
ejabberd_configured="/etc/ejabberd/configured"
ejabberd_restart=0

Expand All @@ -58,16 +58,27 @@ if [ ! -f "$ejabberd_configured" ]; then

cp "$ejabberd_config" "$ejabberd_config.orig"

port_config=$(grep ' {5222, ejabberd_c2s, \[' $ejabberd_config)
port_config=$(grep '^ port: 5222' $ejabberd_config)
if [ -n "$port_config" ]; then
ejabberd_restart=1
sed -i 's/{5222, ejabberd_c2s,/{15222, ejabberd_c2s,/' "$ejabberd_config"
sed -i 's/^ port: 5222/ port: 15222/' "$ejabberd_config"
fi

host_config=$(grep '%% {hosts, \["localhost"\]}.' $ejabberd_config)
host_config=$(grep -zoP '\nhosts:\n - "localhost"\n\n' $ejabberd_config)
if [ -n "$host_config" ]; then
ejabberd_restart=1
sed -i "s/{hosts, \\[\"localhost\"\\]}./{hosts, [\"localhost\", \"$HOSTNAME\"]}./" "$ejabberd_config"
sed -i "s/^ - \"localhost\"/ - \"localhost\"\n - \"$HOSTNAME\"/" "$ejabberd_config"
fi

activate_digest_auth=$(grep '^disable_sasl_mechanisms: "digest-md5"' $ejabberd_config)
if [ -n "$activate_digest_auth" ]; then
ejabberd_restart=1
sed -i 's/^disable_sasl_mechanisms:/#disable_sasl_mechanisms:/' "$ejabberd_config"
fi

store_password_plain=$(grep '^auth_password_format: scram' $ejabberd_config)
if [ -n "$store_password_plain" ]; then
sed -i 's/^auth_password_format: scram/auth_password_format: plain/' $ejabberd_config
fi

iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
Expand Down

0 comments on commit 4338c73

Please sign in to comment.