mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-10-30 18:50:53 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			93 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| load './funcs.rb'
 | |
| 
 | |
| Vagrant.configure("2") do |config|
 | |
| 
 | |
|   config.vm.synced_folder "../..", "/mailinabox", id: "mailinabox", automount: false
 | |
|   use_preloaded_box config, "ubuntu/jammy64"
 | |
| 
 | |
|   # fresh install with encryption-at-rest
 | |
| 
 | |
|   if ENV['tests']=='all'
 | |
|     config.vm.define "remote-nextcloud-docker-ehdd" do |m1|
 | |
|       m1.vm.provision :shell, :inline => <<-SH
 | |
| cd /mailinabox
 | |
| export PRIMARY_HOSTNAME=qa1.abc.com
 | |
| export FEATURE_MUNIN=false
 | |
| export EHDD_KEYFILE=$HOME/keyfile
 | |
| echo -n "boo" >$EHDD_KEYFILE
 | |
| tests/system-setup/remote-nextcloud-docker.sh || exit 1
 | |
| tests/runner.sh ehdd default remote-nextcloud || exit 2
 | |
| SH
 | |
|     end
 | |
|   end
 | |
| 
 | |
|   # remote-nextcloud-docker w/basic data
 | |
| 
 | |
|   config.vm.define "remote-nextcloud-docker" do |m1|
 | |
|     m1.vm.provision :shell, :inline => <<-SH
 | |
| cd /mailinabox
 | |
| export PRIMARY_HOSTNAME=qa2.abc.com
 | |
| export FEATURE_MUNIN=false
 | |
| tests/system-setup/remote-nextcloud-docker.sh upgrade basic || exit 1
 | |
| tests/runner.sh default remote-nextcloud upgrade-basic || exit 2
 | |
| SH
 | |
|   end
 | |
| 
 | |
| 
 | |
|   # upgrade-from-upstream
 | |
|   
 | |
|   config.vm.define "upgrade-from-upstream" do |m1|
 | |
|     m1.vm.provision :shell, :inline => <<-SH
 | |
| cd /mailinabox
 | |
| export PRIMARY_HOSTNAME=qa3.abc.com
 | |
| export UPSTREAM_TAG=jammyjellyfish2204
 | |
| tests/system-setup/upgrade-from-upstream.sh basic totpuser || exit 1
 | |
| tests/runner.sh upgrade-basic upgrade-totpuser default || exit 2
 | |
| SH
 | |
|   end
 | |
| 
 | |
|   # upgrade
 | |
|   
 | |
|   # this test is only needed when testing migrations from miabldap
 | |
|   # to a newer miabldap with a migration step
 | |
|   #
 | |
|   # upgrade will handle testing upgrades of
 | |
|   # miabldap with or without a new migration step
 | |
|   config.vm.define "upgrade" do |m1|
 | |
|     m1.vm.provision :shell, :inline => <<-SH
 | |
| cd /mailinabox
 | |
| export PRIMARY_HOSTNAME=upgrade.abc.com
 | |
| tests/system-setup/upgrade.sh basic totpuser || exit 1
 | |
| tests/runner.sh upgrade-basic upgrade-totpuser default || exit 2
 | |
| SH
 | |
|   end
 | |
| 
 | |
|   # unsetvars: because miab sets bash '-e' to fail any setup script
 | |
|   # when a script command returns a non-zero exit code, and more
 | |
|   # importantly '-u' which fails scripts when any unset variable is
 | |
|   # accessed, this definition sets a minimal number of environment
 | |
|   # variables prior to running start.sh. Doing so will test that no
 | |
|   # failures occur during setup in the most common use case because
 | |
|   # other vagrant definitions in this file load
 | |
|   # tests/system-setup/setup-default.sh, which pre-assign a value to
 | |
|   # most variables.
 | |
| 
 | |
|   if ENV['tests']=='all' or ENV['tests']=='pre-commit'
 | |
|     config.vm.define "unsetvars" do |m1|
 | |
|       m1.vm.hostname = "mailinabox.lan"
 | |
|       m1.vm.network "private_network", ip: "192.168.50.4"
 | |
|       m1.vm.provision :shell, :inline => <<-SH
 | |
| export NONINTERACTIVE=1
 | |
| export PUBLIC_IP=auto
 | |
| export PUBLIC_IPV6=auto
 | |
| export PRIMARY_HOSTNAME=auto
 | |
| export SKIP_NETWORK_CHECKS=1
 | |
| cd /mailinabox
 | |
| setup/start.sh
 | |
| SH
 | |
|     end
 | |
|   end
 | |
|   
 | |
| 
 | |
| end
 |