Skip to content

Commit 94cca4d

Browse files
committedNov 29, 2016
Refactored Unit Tests
1 parent f759b39 commit 94cca4d

15 files changed

+1902
-126
lines changed
 

‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.vagrant
22
*.log
3-
.DS_Store
3+
.DS_Store
4+
!results/.gitkeep
5+
results/*

‎tests/Vagrant/Vagrantfile.precise32

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/precise32"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# config.vm.network "forwarded_port", guest: 80, host: 8080
26+
27+
# Create a private network, which allows host-only access to the machine
28+
# using a specific IP.
29+
# config.vm.network "private_network", ip: "192.168.33.10"
30+
31+
# Create a public network, which generally matched to bridged network.
32+
# Bridged networks make the machine appear as another physical device on
33+
# your network.
34+
# config.vm.network "public_network"
35+
36+
# Share an additional folder to the guest VM. The first argument is
37+
# the path on the host to the actual folder. The second argument is
38+
# the path on the guest to mount the folder. And the optional third
39+
# argument is a set of non-required options.
40+
# config.vm.synced_folder "../data", "/vagrant_data"
41+
42+
# Provider-specific configuration so you can fine-tune various
43+
# backing providers for Vagrant. These expose provider-specific options.
44+
# Example for VirtualBox:
45+
#
46+
# config.vm.provider "virtualbox" do |vb|
47+
# # Display the VirtualBox GUI when booting the machine
48+
# vb.gui = true
49+
#
50+
# # Customize the amount of memory on the VM:
51+
# vb.memory = "1024"
52+
# end
53+
#
54+
# View the documentation for the provider you are using for more
55+
# information on available options.
56+
57+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58+
# such as FTP and Heroku are also available. See the documentation at
59+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
60+
# config.push.define "atlas" do |push|
61+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62+
# end
63+
64+
# Enable provisioning with a shell script. Additional provisioners such as
65+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66+
# documentation for more information about their specific syntax and use.
67+
# config.vm.provision "shell", inline: <<-SHELL
68+
# sudo apt-get update
69+
# sudo apt-get install -y apache2
70+
# SHELL
71+
end

‎tests/Vagrant/Vagrantfile.precise64

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/precise64"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# config.vm.network "forwarded_port", guest: 80, host: 8080
26+
27+
# Create a private network, which allows host-only access to the machine
28+
# using a specific IP.
29+
# config.vm.network "private_network", ip: "192.168.33.10"
30+
31+
# Create a public network, which generally matched to bridged network.
32+
# Bridged networks make the machine appear as another physical device on
33+
# your network.
34+
# config.vm.network "public_network"
35+
36+
# Share an additional folder to the guest VM. The first argument is
37+
# the path on the host to the actual folder. The second argument is
38+
# the path on the guest to mount the folder. And the optional third
39+
# argument is a set of non-required options.
40+
# config.vm.synced_folder "../data", "/vagrant_data"
41+
42+
# Provider-specific configuration so you can fine-tune various
43+
# backing providers for Vagrant. These expose provider-specific options.
44+
# Example for VirtualBox:
45+
#
46+
# config.vm.provider "virtualbox" do |vb|
47+
# # Display the VirtualBox GUI when booting the machine
48+
# vb.gui = true
49+
#
50+
# # Customize the amount of memory on the VM:
51+
# vb.memory = "1024"
52+
# end
53+
#
54+
# View the documentation for the provider you are using for more
55+
# information on available options.
56+
57+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58+
# such as FTP and Heroku are also available. See the documentation at
59+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
60+
# config.push.define "atlas" do |push|
61+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62+
# end
63+
64+
# Enable provisioning with a shell script. Additional provisioners such as
65+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66+
# documentation for more information about their specific syntax and use.
67+
# config.vm.provision "shell", inline: <<-SHELL
68+
# sudo apt-get update
69+
# sudo apt-get install -y apache2
70+
# SHELL
71+
end

‎tests/Vagrant/Vagrantfile.trusty32

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/trusty32"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# config.vm.network "forwarded_port", guest: 80, host: 8080
26+
27+
# Create a private network, which allows host-only access to the machine
28+
# using a specific IP.
29+
# config.vm.network "private_network", ip: "192.168.33.10"
30+
31+
# Create a public network, which generally matched to bridged network.
32+
# Bridged networks make the machine appear as another physical device on
33+
# your network.
34+
# config.vm.network "public_network"
35+
36+
# Share an additional folder to the guest VM. The first argument is
37+
# the path on the host to the actual folder. The second argument is
38+
# the path on the guest to mount the folder. And the optional third
39+
# argument is a set of non-required options.
40+
# config.vm.synced_folder "../data", "/vagrant_data"
41+
42+
# Provider-specific configuration so you can fine-tune various
43+
# backing providers for Vagrant. These expose provider-specific options.
44+
# Example for VirtualBox:
45+
#
46+
# config.vm.provider "virtualbox" do |vb|
47+
# # Display the VirtualBox GUI when booting the machine
48+
# vb.gui = true
49+
#
50+
# # Customize the amount of memory on the VM:
51+
# vb.memory = "1024"
52+
# end
53+
#
54+
# View the documentation for the provider you are using for more
55+
# information on available options.
56+
57+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58+
# such as FTP and Heroku are also available. See the documentation at
59+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
60+
# config.push.define "atlas" do |push|
61+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62+
# end
63+
64+
# Enable provisioning with a shell script. Additional provisioners such as
65+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66+
# documentation for more information about their specific syntax and use.
67+
# config.vm.provision "shell", inline: <<-SHELL
68+
# sudo apt-get update
69+
# sudo apt-get install -y apache2
70+
# SHELL
71+
end

‎tests/Vagrant/Vagrantfile.trusty64

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/trusty64"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# config.vm.network "forwarded_port", guest: 80, host: 8080
26+
27+
# Create a private network, which allows host-only access to the machine
28+
# using a specific IP.
29+
# config.vm.network "private_network", ip: "192.168.33.10"
30+
31+
# Create a public network, which generally matched to bridged network.
32+
# Bridged networks make the machine appear as another physical device on
33+
# your network.
34+
# config.vm.network "public_network"
35+
36+
# Share an additional folder to the guest VM. The first argument is
37+
# the path on the host to the actual folder. The second argument is
38+
# the path on the guest to mount the folder. And the optional third
39+
# argument is a set of non-required options.
40+
# config.vm.synced_folder "../data", "/vagrant_data"
41+
42+
# Provider-specific configuration so you can fine-tune various
43+
# backing providers for Vagrant. These expose provider-specific options.
44+
# Example for VirtualBox:
45+
#
46+
config.vm.provider "virtualbox" do |vb|
47+
# Display the VirtualBox GUI when booting the machine
48+
# vb.gui = true
49+
50+
# Customize the amount of memory on the VM:
51+
vb.memory = "2048"
52+
end
53+
#
54+
# View the documentation for the provider you are using for more
55+
# information on available options.
56+
57+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58+
# such as FTP and Heroku are also available. See the documentation at
59+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
60+
# config.push.define "atlas" do |push|
61+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62+
# end
63+
64+
# Enable provisioning with a shell script. Additional provisioners such as
65+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66+
# documentation for more information about their specific syntax and use.
67+
# config.vm.provision "shell", inline: <<-SHELL
68+
# sudo apt-get update
69+
# sudo apt-get install -y apache2
70+
# SHELL
71+
end

‎tests/Vagrant/Vagrantfile.xenial32

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/xenial32"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# config.vm.network "forwarded_port", guest: 80, host: 8080
26+
27+
# Create a private network, which allows host-only access to the machine
28+
# using a specific IP.
29+
# config.vm.network "private_network", ip: "192.168.33.10"
30+
31+
# Create a public network, which generally matched to bridged network.
32+
# Bridged networks make the machine appear as another physical device on
33+
# your network.
34+
# config.vm.network "public_network"
35+
36+
# Share an additional folder to the guest VM. The first argument is
37+
# the path on the host to the actual folder. The second argument is
38+
# the path on the guest to mount the folder. And the optional third
39+
# argument is a set of non-required options.
40+
# config.vm.synced_folder "../data", "/vagrant_data"
41+
42+
# Provider-specific configuration so you can fine-tune various
43+
# backing providers for Vagrant. These expose provider-specific options.
44+
# Example for VirtualBox:
45+
#
46+
# config.vm.provider "virtualbox" do |vb|
47+
# # Display the VirtualBox GUI when booting the machine
48+
# vb.gui = true
49+
#
50+
# # Customize the amount of memory on the VM:
51+
# vb.memory = "1024"
52+
# end
53+
#
54+
# View the documentation for the provider you are using for more
55+
# information on available options.
56+
57+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58+
# such as FTP and Heroku are also available. See the documentation at
59+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
60+
# config.push.define "atlas" do |push|
61+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62+
# end
63+
64+
# Enable provisioning with a shell script. Additional provisioners such as
65+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66+
# documentation for more information about their specific syntax and use.
67+
# config.vm.provision "shell", inline: <<-SHELL
68+
# sudo apt-get update
69+
# sudo apt-get install -y apache2
70+
# SHELL
71+
end
File renamed without changes.

‎tests/results/.gitkeep

Whitespace-only changes.

‎tests/results/Vagrantfile.precise32.txt

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+

2+
unit-tests.sh:
3+
4+
Test Setup
5+
Adding user `testuser3' ...
6+
Adding new group `testuser3' (1002) ...
7+
Adding new user `testuser3' (1002) with group `testuser3' ...
8+
Creating home directory `/home/testuser3' ...
9+
Copying files from `/etc/skel' ...
10+
testuser3 ALL=(ALL) NOPASSWD: ALL
11+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local
12+
Rules updated
13+
Rules updated (v6)
14+
Command may disrupt existing ssh connections. Proceed with operation (y|n)? Firewall is active and enabled on system startup
15+
Setting up swapspace version 1, size = 2097148 KiB
16+
no label, UUID=9e4e48f2-9cb6-4532-b8ac-494cb51acc71
17+
vm.swappiness = 10
18+
vm.vfs_cache_pressure = 50
19+
vm.swappiness = 60
20+
vm.vfs_cache_pressure = 100
21+
America/New_York
22+
23+
Current default time zone: 'America/New_York'
24+
Local time is now: Tue Nov 29 06:56:17 EST 2016.
25+
Universal Time is now: Tue Nov 29 11:56:17 UTC 2016.
26+
27+
Etc/UTC
28+
29+
Current default time zone: 'Etc/UTC'
30+
Local time is now: Tue Nov 29 11:56:17 UTC 2016.
31+
Universal Time is now: Tue Nov 29 11:56:17 UTC 2016.
32+
33+
Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
34+
Hit http://archive.ubuntu.com precise Release.gpg
35+
Get:2 http://security.ubuntu.com precise-security Release [55.5 kB]
36+
Get:3 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
37+
Hit http://archive.ubuntu.com precise-backports Release.gpg
38+
Hit http://archive.ubuntu.com precise Release
39+
Get:4 http://archive.ubuntu.com precise-updates Release [55.4 kB]
40+
Get:5 http://security.ubuntu.com precise-security/main Sources [146 kB]
41+
Get:6 http://security.ubuntu.com precise-security/universe Sources [53.7 kB]
42+
Hit http://archive.ubuntu.com precise-backports Release
43+
Get:7 http://security.ubuntu.com precise-security/main i386 Packages [722 kB]
44+
Get:8 http://archive.ubuntu.com precise/main Sources [934 kB]
45+
Get:9 http://security.ubuntu.com precise-security/universe i386 Packages [147 kB]
46+
Get:10 http://security.ubuntu.com precise-security/main TranslationIndex [208 B]
47+
Get:11 http://security.ubuntu.com precise-security/universe TranslationIndex [205 B]
48+
Get:12 http://security.ubuntu.com precise-security/main Translation-en [266 kB]
49+
Get:13 http://archive.ubuntu.com precise/restricted Sources [5,470 B]
50+
Get:14 http://archive.ubuntu.com precise/universe Sources [5,019 kB]
51+
Get:15 http://security.ubuntu.com precise-security/universe Translation-en [89.0 kB]
52+
Get:16 http://archive.ubuntu.com precise/multiverse Sources [155 kB]
53+
Hit http://archive.ubuntu.com precise/main i386 Packages
54+
Hit http://archive.ubuntu.com precise/restricted i386 Packages
55+
Hit http://archive.ubuntu.com precise/universe i386 Packages
56+
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
57+
Hit http://archive.ubuntu.com precise/main TranslationIndex
58+
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
59+
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
60+
Hit http://archive.ubuntu.com precise/universe TranslationIndex
61+
Get:17 http://archive.ubuntu.com precise-updates/main Sources [499 kB]
62+
Get:18 http://archive.ubuntu.com precise-updates/restricted Sources [8,840 B]
63+
Get:19 http://archive.ubuntu.com precise-updates/universe Sources [132 kB]
64+
Get:20 http://archive.ubuntu.com precise-updates/multiverse Sources [10.5 kB]
65+
Get:21 http://archive.ubuntu.com precise-updates/main i386 Packages [1,103 kB]
66+
Get:22 http://archive.ubuntu.com precise-updates/restricted i386 Packages [15.4 kB]
67+
Get:23 http://archive.ubuntu.com precise-updates/universe i386 Packages [292 kB]
68+
Get:24 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [17.3 kB]
69+
Get:25 http://archive.ubuntu.com precise-updates/main TranslationIndex [208 B]
70+
Get:26 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [202 B]
71+
Get:27 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [202 B]
72+
Get:28 http://archive.ubuntu.com precise-updates/universe TranslationIndex [205 B]
73+
Get:29 http://archive.ubuntu.com precise-backports/main Sources [5,922 B]
74+
Get:30 http://archive.ubuntu.com precise-backports/restricted Sources [28 B]
75+
Get:31 http://archive.ubuntu.com precise-backports/universe Sources [44.2 kB]
76+
Get:32 http://archive.ubuntu.com precise-backports/multiverse Sources [5,750 B]
77+
Hit http://archive.ubuntu.com precise-backports/main i386 Packages
78+
Hit http://archive.ubuntu.com precise-backports/restricted i386 Packages
79+
Hit http://archive.ubuntu.com precise-backports/universe i386 Packages
80+
Hit http://archive.ubuntu.com precise-backports/multiverse i386 Packages
81+
Hit http://archive.ubuntu.com precise-backports/main TranslationIndex
82+
Hit http://archive.ubuntu.com precise-backports/multiverse TranslationIndex
83+
Hit http://archive.ubuntu.com precise-backports/restricted TranslationIndex
84+
Hit http://archive.ubuntu.com precise-backports/universe TranslationIndex
85+
Hit http://archive.ubuntu.com precise/main Translation-en
86+
Hit http://archive.ubuntu.com precise/multiverse Translation-en
87+
Hit http://archive.ubuntu.com precise/restricted Translation-en
88+
Hit http://archive.ubuntu.com precise/universe Translation-en
89+
Get:33 http://archive.ubuntu.com precise-updates/main Translation-en [428 kB]
90+
Get:34 http://archive.ubuntu.com precise-updates/multiverse Translation-en [10.1 kB]
91+
Get:35 http://archive.ubuntu.com precise-updates/restricted Translation-en [3,682 B]
92+
Get:36 http://archive.ubuntu.com precise-updates/universe Translation-en [170 kB]
93+
Hit http://archive.ubuntu.com precise-backports/main Translation-en
94+
Hit http://archive.ubuntu.com precise-backports/multiverse Translation-en
95+
Hit http://archive.ubuntu.com precise-backports/restricted Translation-en
96+
Hit http://archive.ubuntu.com precise-backports/universe Translation-en
97+
Fetched 10.4 MB in 18s (549 kB/s)
98+
Reading package lists...
99+
Reading package lists...
100+
Building dependency tree...
101+
Reading state information...
102+
The following packages were automatically installed and are no longer required:
103+
libxfixes3 xserver-common xserver-xorg-core libxfont1 xfonts-base
104+
libxcomposite1 libfontenc1 xfonts-utils libgl1-mesa-dri libxdamage1
105+
x11-xkb-utils xfonts-encodings libxrandr2 libxkbfile1 libllvm3.0
106+
Use 'apt-get autoremove' to remove them.
107+
The following extra packages will be installed:
108+
libopts25
109+
Suggested packages:
110+
ntp-doc
111+
The following NEW packages will be installed:
112+
libopts25 ntp
113+
0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded.
114+
Need to get 658 kB of archives.
115+
After this operation, 1,629 kB of additional disk space will be used.
116+
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main libopts25 i386 1:5.12-0.1ubuntu1 [58.4 kB]
117+
Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main ntp i386 1:4.2.6.p3+dfsg-1ubuntu3.11 [600 kB]
118+
Fetched 658 kB in 2s (284 kB/s)
119+
Selecting previously unselected package libopts25.
120+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 66634 files and directories currently installed.)
121+
Unpacking libopts25 (from .../libopts25_1%3a5.12-0.1ubuntu1_i386.deb) ...
122+
Selecting previously unselected package ntp.
123+
Unpacking ntp (from .../ntp_1%3a4.2.6.p3+dfsg-1ubuntu3.11_i386.deb) ...
124+
Processing triggers for man-db ...
125+
Processing triggers for ureadahead ...
126+
Setting up libopts25 (1:5.12-0.1ubuntu1) ...
127+
Setting up ntp (1:4.2.6.p3+dfsg-1ubuntu3.11) ...
128+
* Starting NTP server ntpd  [ OK ]
129+
Processing triggers for libc-bin ...
130+
ldconfig deferred processing now taking place
131+
unit-tests.sh: line 88: timedatectl: command not found
132+
Line 88: testNTP: assertContains() failed. Expected "" to contain "NTP synchronized: yes"..
133+
Test Teardown
134+
Removing user `testuser3' from group `sudo' ...
135+
Done.
136+
Looking for files to backup/remove ...
137+
Removing files ...
138+
Removing user `testuser3' ...
139+
Warning: group `testuser3' has no more members.
140+
Done.
141+
Rule deleted
142+
Rule deleted (v6)
143+
Firewall stopped and disabled on system startup
144+
Reading package lists...
145+
Building dependency tree...
146+
Reading state information...
147+
The following packages will be REMOVED:
148+
libfontenc1* libgl1-mesa-dri* libllvm3.0* libopts25* libxcomposite1*
149+
libxdamage1* libxfixes3* libxfont1* libxkbfile1* libxrandr2* ntp*
150+
x11-xkb-utils* xfonts-base* xfonts-encodings* xfonts-utils* xserver-common*
151+
xserver-xorg-core*
152+
0 upgraded, 0 newly installed, 17 to remove and 4 not upgraded.
153+
After this operation, 54.9 MB disk space will be freed.
154+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 66679 files and directories currently installed.)
155+
Removing xserver-xorg-core ...
156+
Purging configuration files for xserver-xorg-core ...
157+
rm: cannot remove `/var/log/Xorg.*.log': No such file or directory
158+
rm: cannot remove `/var/log/Xorg.*.log.old': No such file or directory
159+
Removing xfonts-base ...
160+
Purging configuration files for xfonts-base ...
161+
warning: /usr/share/fonts/X11/misc does not exist or is not a directory
162+
warning: /usr/share/fonts/X11/misc does not exist or is not a directory
163+
Removing xfonts-utils ...
164+
Purging configuration files for xfonts-utils ...
165+
Removing libxfont1 ...
166+
Purging configuration files for libxfont1 ...
167+
Removing libfontenc1 ...
168+
Purging configuration files for libfontenc1 ...
169+
Removing libgl1-mesa-dri ...
170+
Removing libllvm3.0 ...
171+
Purging configuration files for libllvm3.0 ...
172+
Removing ntp ...
173+
* Stopping NTP server ntpd  [ OK ]
174+
Purging configuration files for ntp ...
175+
Removing libopts25 ...
176+
Purging configuration files for libopts25 ...
177+
Removing libxcomposite1 ...
178+
Purging configuration files for libxcomposite1 ...
179+
Removing libxdamage1 ...
180+
Purging configuration files for libxdamage1 ...
181+
Removing libxfixes3 ...
182+
Purging configuration files for libxfixes3 ...
183+
Removing xserver-common ...
184+
Removing x11-xkb-utils ...
185+
Removing libxkbfile1 ...
186+
Purging configuration files for libxkbfile1 ...
187+
Removing libxrandr2 ...
188+
Purging configuration files for libxrandr2 ...
189+
Removing xfonts-encodings ...
190+
Processing triggers for man-db ...
191+
Processing triggers for fontconfig ...
192+
Processing triggers for libc-bin ...
193+
ldconfig deferred processing now taking place
194+
Processing triggers for ureadahead ...
195+
196+
197+
RESULTS: 12 tests passed. 1 tests failed. 13 tests total.
198+
Execution completed in 30 second(s)...
199+
200+
Unit Tests failed.

‎tests/results/Vagrantfile.precise64.txt

+214
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+

2+
unit-tests.sh:
3+
4+
Test Setup
5+
Adding user `testuser3' ...
6+
Adding new group `testuser3' (1002) ...
7+
Adding new user `testuser3' (1002) with group `testuser3' ...
8+
Creating home directory `/home/testuser3' ...
9+
Copying files from `/etc/skel' ...
10+
testuser3 ALL=(ALL) NOPASSWD: ALL
11+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local
12+
Rules updated
13+
Rules updated (v6)
14+
Command may disrupt existing ssh connections. Proceed with operation (y|n)? Firewall is active and enabled on system startup
15+
Setting up swapspace version 1, size = 2097148 KiB
16+
no label, UUID=08d44c74-226f-45cd-bbf5-38655c1548db
17+
vm.swappiness = 10
18+
vm.vfs_cache_pressure = 50
19+
vm.swappiness = 60
20+
vm.vfs_cache_pressure = 100
21+
America/New_York
22+
23+
Current default time zone: 'America/New_York'
24+
Local time is now: Tue Nov 29 07:00:42 EST 2016.
25+
Universal Time is now: Tue Nov 29 12:00:42 UTC 2016.
26+
27+
Etc/UTC
28+
29+
Current default time zone: 'Etc/UTC'
30+
Local time is now: Tue Nov 29 12:00:43 UTC 2016.
31+
Universal Time is now: Tue Nov 29 12:00:43 UTC 2016.
32+
33+
Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
34+
Hit http://archive.ubuntu.com precise Release.gpg
35+
Get:2 http://security.ubuntu.com precise-security Release [55.5 kB]
36+
Get:3 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
37+
Hit http://archive.ubuntu.com precise-backports Release.gpg
38+
Hit http://archive.ubuntu.com precise Release
39+
Get:4 http://archive.ubuntu.com precise-updates Release [55.4 kB]
40+
Get:5 http://security.ubuntu.com precise-security/main Sources [146 kB]
41+
Get:6 http://security.ubuntu.com precise-security/universe Sources [53.7 kB]
42+
Hit http://archive.ubuntu.com precise-backports Release
43+
Get:7 http://security.ubuntu.com precise-security/main amd64 Packages [650 kB]
44+
Get:8 http://archive.ubuntu.com precise/main Sources [934 kB]
45+
Get:9 http://security.ubuntu.com precise-security/universe amd64 Packages [139 kB]
46+
Get:10 http://security.ubuntu.com precise-security/main i386 Packages [722 kB]
47+
Get:11 http://security.ubuntu.com precise-security/universe i386 Packages [147 kB]
48+
Get:12 http://archive.ubuntu.com precise/restricted Sources [5,470 B]
49+
Get:13 http://security.ubuntu.com precise-security/main TranslationIndex [208 B]
50+
Get:14 http://archive.ubuntu.com precise/universe Sources [5,019 kB]
51+
Get:15 http://security.ubuntu.com precise-security/universe TranslationIndex [205 B]
52+
Get:16 http://security.ubuntu.com precise-security/main Translation-en [266 kB]
53+
Get:17 http://security.ubuntu.com precise-security/universe Translation-en [89.0 kB]
54+
Get:18 http://archive.ubuntu.com precise/multiverse Sources [155 kB]
55+
Hit http://archive.ubuntu.com precise/main amd64 Packages
56+
Hit http://archive.ubuntu.com precise/restricted amd64 Packages
57+
Hit http://archive.ubuntu.com precise/universe amd64 Packages
58+
Hit http://archive.ubuntu.com precise/multiverse amd64 Packages
59+
Hit http://archive.ubuntu.com precise/main i386 Packages
60+
Hit http://archive.ubuntu.com precise/restricted i386 Packages
61+
Hit http://archive.ubuntu.com precise/universe i386 Packages
62+
Hit http://archive.ubuntu.com precise/multiverse i386 Packages
63+
Hit http://archive.ubuntu.com precise/main TranslationIndex
64+
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
65+
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
66+
Hit http://archive.ubuntu.com precise/universe TranslationIndex
67+
Get:19 http://archive.ubuntu.com precise-updates/main Sources [499 kB]
68+
Get:20 http://archive.ubuntu.com precise-updates/restricted Sources [8,840 B]
69+
Get:21 http://archive.ubuntu.com precise-updates/universe Sources [132 kB]
70+
Get:22 http://archive.ubuntu.com precise-updates/multiverse Sources [10.5 kB]
71+
Get:23 http://archive.ubuntu.com precise-updates/main amd64 Packages [1,032 kB]
72+
Get:24 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [15.4 kB]
73+
Get:25 http://archive.ubuntu.com precise-updates/universe amd64 Packages [283 kB]
74+
Get:26 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [17.1 kB]
75+
Get:27 http://archive.ubuntu.com precise-updates/main i386 Packages [1,103 kB]
76+
Get:28 http://archive.ubuntu.com precise-updates/restricted i386 Packages [15.4 kB]
77+
Get:29 http://archive.ubuntu.com precise-updates/universe i386 Packages [292 kB]
78+
Get:30 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [17.3 kB]
79+
Get:31 http://archive.ubuntu.com precise-updates/main TranslationIndex [208 B]
80+
Get:32 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [202 B]
81+
Get:33 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [202 B]
82+
Get:34 http://archive.ubuntu.com precise-updates/universe TranslationIndex [205 B]
83+
Get:35 http://archive.ubuntu.com precise-backports/main Sources [5,922 B]
84+
Get:36 http://archive.ubuntu.com precise-backports/restricted Sources [28 B]
85+
Get:37 http://archive.ubuntu.com precise-backports/universe Sources [44.2 kB]
86+
Get:38 http://archive.ubuntu.com precise-backports/multiverse Sources [5,750 B]
87+
Hit http://archive.ubuntu.com precise-backports/main amd64 Packages
88+
Hit http://archive.ubuntu.com precise-backports/restricted amd64 Packages
89+
Hit http://archive.ubuntu.com precise-backports/universe amd64 Packages
90+
Hit http://archive.ubuntu.com precise-backports/multiverse amd64 Packages
91+
Hit http://archive.ubuntu.com precise-backports/main i386 Packages
92+
Hit http://archive.ubuntu.com precise-backports/restricted i386 Packages
93+
Hit http://archive.ubuntu.com precise-backports/universe i386 Packages
94+
Hit http://archive.ubuntu.com precise-backports/multiverse i386 Packages
95+
Hit http://archive.ubuntu.com precise-backports/main TranslationIndex
96+
Hit http://archive.ubuntu.com precise-backports/multiverse TranslationIndex
97+
Hit http://archive.ubuntu.com precise-backports/restricted TranslationIndex
98+
Hit http://archive.ubuntu.com precise-backports/universe TranslationIndex
99+
Hit http://archive.ubuntu.com precise/main Translation-en
100+
Hit http://archive.ubuntu.com precise/multiverse Translation-en
101+
Hit http://archive.ubuntu.com precise/restricted Translation-en
102+
Hit http://archive.ubuntu.com precise/universe Translation-en
103+
Get:39 http://archive.ubuntu.com precise-updates/main Translation-en [428 kB]
104+
Get:40 http://archive.ubuntu.com precise-updates/multiverse Translation-en [10.1 kB]
105+
Get:41 http://archive.ubuntu.com precise-updates/restricted Translation-en [3,682 B]
106+
Get:42 http://archive.ubuntu.com precise-updates/universe Translation-en [170 kB]
107+
Hit http://archive.ubuntu.com precise-backports/main Translation-en
108+
Hit http://archive.ubuntu.com precise-backports/multiverse Translation-en
109+
Hit http://archive.ubuntu.com precise-backports/restricted Translation-en
110+
Hit http://archive.ubuntu.com precise-backports/universe Translation-en
111+
Fetched 12.5 MB in 18s (678 kB/s)
112+
Reading package lists...
113+
Reading package lists...
114+
Building dependency tree...
115+
Reading state information...
116+
The following packages were automatically installed and are no longer required:
117+
libxfixes3 libxcomposite1 xfonts-encodings x11-xkb-utils xserver-xorg-core
118+
xserver-common libgl1-mesa-dri xfonts-utils libxfont1 xfonts-base
119+
libfontenc1 libxdamage1 libxrandr2 libxkbfile1 libllvm3.0
120+
Use 'apt-get autoremove' to remove them.
121+
The following extra packages will be installed:
122+
libopts25
123+
Suggested packages:
124+
ntp-doc
125+
The following NEW packages will be installed:
126+
libopts25 ntp
127+
0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded.
128+
Need to get 676 kB of archives.
129+
After this operation, 1,714 kB of additional disk space will be used.
130+
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main libopts25 amd64 1:5.12-0.1ubuntu1 [59.9 kB]
131+
Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main ntp amd64 1:4.2.6.p3+dfsg-1ubuntu3.11 [617 kB]
132+
Fetched 676 kB in 1s (406 kB/s)
133+
Selecting previously unselected package libopts25.
134+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 65970 files and directories currently installed.)
135+
Unpacking libopts25 (from .../libopts25_1%3a5.12-0.1ubuntu1_amd64.deb) ...
136+
Selecting previously unselected package ntp.
137+
Unpacking ntp (from .../ntp_1%3a4.2.6.p3+dfsg-1ubuntu3.11_amd64.deb) ...
138+
Processing triggers for man-db ...
139+
Processing triggers for ureadahead ...
140+
Setting up libopts25 (1:5.12-0.1ubuntu1) ...
141+
Setting up ntp (1:4.2.6.p3+dfsg-1ubuntu3.11) ...
142+
* Starting NTP server ntpd  [ OK ]
143+
Processing triggers for libc-bin ...
144+
ldconfig deferred processing now taking place
145+
unit-tests.sh: line 88: timedatectl: command not found
146+
Line 88: testNTP: assertContains() failed. Expected "" to contain "NTP synchronized: yes"..
147+
Test Teardown
148+
Removing user `testuser3' from group `sudo' ...
149+
Done.
150+
Looking for files to backup/remove ...
151+
Removing files ...
152+
Removing user `testuser3' ...
153+
Warning: group `testuser3' has no more members.
154+
Done.
155+
Rule deleted
156+
Rule deleted (v6)
157+
Firewall stopped and disabled on system startup
158+
Reading package lists...
159+
Building dependency tree...
160+
Reading state information...
161+
The following packages will be REMOVED:
162+
libfontenc1* libgl1-mesa-dri* libllvm3.0* libopts25* libxcomposite1*
163+
libxdamage1* libxfixes3* libxfont1* libxkbfile1* libxrandr2* ntp*
164+
x11-xkb-utils* xfonts-base* xfonts-encodings* xfonts-utils* xserver-common*
165+
xserver-xorg-core*
166+
0 upgraded, 0 newly installed, 17 to remove and 4 not upgraded.
167+
After this operation, 57.0 MB disk space will be freed.
168+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 66015 files and directories currently installed.)
169+
Removing xserver-xorg-core ...
170+
Purging configuration files for xserver-xorg-core ...
171+
rm: cannot remove `/var/log/Xorg.*.log': No such file or directory
172+
rm: cannot remove `/var/log/Xorg.*.log.old': No such file or directory
173+
Removing xfonts-base ...
174+
Purging configuration files for xfonts-base ...
175+
warning: /usr/share/fonts/X11/misc does not exist or is not a directory
176+
warning: /usr/share/fonts/X11/misc does not exist or is not a directory
177+
Removing xfonts-utils ...
178+
Purging configuration files for xfonts-utils ...
179+
Removing libxfont1 ...
180+
Purging configuration files for libxfont1 ...
181+
Removing libfontenc1 ...
182+
Purging configuration files for libfontenc1 ...
183+
Removing libgl1-mesa-dri ...
184+
Removing libllvm3.0 ...
185+
Purging configuration files for libllvm3.0 ...
186+
Removing ntp ...
187+
* Stopping NTP server ntpd  [ OK ]
188+
Purging configuration files for ntp ...
189+
Removing libopts25 ...
190+
Purging configuration files for libopts25 ...
191+
Removing libxcomposite1 ...
192+
Purging configuration files for libxcomposite1 ...
193+
Removing libxdamage1 ...
194+
Purging configuration files for libxdamage1 ...
195+
Removing libxfixes3 ...
196+
Purging configuration files for libxfixes3 ...
197+
Removing xserver-common ...
198+
Removing x11-xkb-utils ...
199+
Removing libxkbfile1 ...
200+
Purging configuration files for libxkbfile1 ...
201+
Removing libxrandr2 ...
202+
Purging configuration files for libxrandr2 ...
203+
Removing xfonts-encodings ...
204+
Processing triggers for man-db ...
205+
Processing triggers for fontconfig ...
206+
Processing triggers for libc-bin ...
207+
ldconfig deferred processing now taking place
208+
Processing triggers for ureadahead ...
209+
210+
211+
RESULTS: 12 tests passed. 1 tests failed. 13 tests total.
212+
Execution completed in 33 second(s)...
213+
214+
Unit Tests failed.

‎tests/results/Vagrantfile.trusty32.txt

+425
Large diffs are not rendered by default.

‎tests/results/Vagrantfile.trusty64.txt

+425
Large diffs are not rendered by default.

‎tests/results/Vagrantfile.xenial64.txt

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+

2+
unit-tests.sh:
3+
4+
Test Setup
5+
Adding user `testuser3' ...
6+
Adding new group `testuser3' (1001) ...
7+
Adding new user `testuser3' (1001) with group `testuser3' ...
8+
Creating home directory `/home/testuser3' ...
9+
Copying files from `/etc/skel' ...
10+
testuser3 ALL=(ALL) NOPASSWD: ALL
11+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local
12+
Rules updated
13+
Rules updated (v6)
14+
Command may disrupt existing ssh connections. Proceed with operation (y|n)? Firewall is active and enabled on system startup
15+
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
16+
no label, UUID=bd261c68-4e54-474c-b02d-1c71d421a833
17+
vm.swappiness = 10
18+
vm.vfs_cache_pressure = 50
19+
vm.swappiness = 60
20+
vm.vfs_cache_pressure = 100
21+
America/New_York
22+
23+
Current default time zone: 'America/New_York'
24+
Local time is now: Tue Nov 29 06:34:51 EST 2016.
25+
Universal Time is now: Tue Nov 29 11:34:51 UTC 2016.
26+
27+
Etc/UTC
28+
29+
Current default time zone: 'Etc/UTC'
30+
Local time is now: Tue Nov 29 11:34:51 UTC 2016.
31+
Universal Time is now: Tue Nov 29 11:34:51 UTC 2016.
32+
33+
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
34+
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
35+
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
36+
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main Sources [50.2 kB]
37+
Get:5 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [1,804 B]
38+
Get:6 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [14.4 kB]
39+
Get:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
40+
Get:8 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [728 B]
41+
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [179 kB]
42+
Get:10 http://archive.ubuntu.com/ubuntu xenial/main Sources [868 kB]
43+
Get:11 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [72.3 kB]
44+
Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [64.0 kB]
45+
Get:13 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [34.4 kB]
46+
Get:14 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [4,808 B]
47+
Get:15 http://archive.ubuntu.com/ubuntu xenial/universe Sources [7,728 kB]
48+
Get:16 http://archive.ubuntu.com/ubuntu xenial/multiverse Sources [179 kB]
49+
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [207 kB]
50+
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [1,804 B]
51+
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [110 kB]
52+
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [3,648 B]
53+
Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [427 kB]
54+
Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [165 kB]
55+
Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [366 kB]
56+
Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [132 kB]
57+
Get:25 http://archive.ubuntu.com/ubuntu xenial-backports/main Sources [3,180 B]
58+
Get:26 http://archive.ubuntu.com/ubuntu xenial-backports/universe Sources [1,868 B]
59+
Get:27 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4,392 B]
60+
Get:28 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3,104 B]
61+
Get:29 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [2,412 B]
62+
Get:30 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [1,216 B]
63+
Fetched 10.9 MB in 9s (1,198 kB/s)
64+
Reading package lists...
65+
Reading package lists...
66+
Building dependency tree...
67+
Reading state information...
68+
The following additional packages will be installed:
69+
libopts25
70+
Suggested packages:
71+
ntp-doc
72+
The following NEW packages will be installed:
73+
libopts25 ntp
74+
0 upgraded, 2 newly installed, 0 to remove and 15 not upgraded.
75+
Need to get 577 kB of archives.
76+
After this operation, 1,791 kB of additional disk space will be used.
77+
Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libopts25 amd64 1:5.18.7-3 [57.8 kB]
78+
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ntp amd64 1:4.2.8p4+dfsg-3ubuntu5.3 [520 kB]
79+
Fetched 577 kB in 2s (283 kB/s)
80+
Selecting previously unselected package libopts25:amd64.
81+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 57661 files and directories currently installed.)
82+
Preparing to unpack .../libopts25_1%3a5.18.7-3_amd64.deb ...
83+
Unpacking libopts25:amd64 (1:5.18.7-3) ...
84+
Selecting previously unselected package ntp.
85+
Preparing to unpack .../ntp_1%3a4.2.8p4+dfsg-3ubuntu5.3_amd64.deb ...
86+
Unpacking ntp (1:4.2.8p4+dfsg-3ubuntu5.3) ...
87+
Processing triggers for libc-bin (2.23-0ubuntu4) ...
88+
Processing triggers for systemd (229-4ubuntu12) ...
89+
Processing triggers for ureadahead (0.100.0-19) ...
90+
Processing triggers for man-db (2.7.5-1) ...
91+
Setting up libopts25:amd64 (1:5.18.7-3) ...
92+
Setting up ntp (1:4.2.8p4+dfsg-3ubuntu5.3) ...
93+
Processing triggers for libc-bin (2.23-0ubuntu4) ...
94+
Processing triggers for systemd (229-4ubuntu12) ...
95+
Processing triggers for ureadahead (0.100.0-19) ...
96+
Test Teardown
97+
Removing user `testuser3' from group `sudo' ...
98+
Done.
99+
Looking for files to backup/remove ...
100+
Removing files ...
101+
Removing user `testuser3' ...
102+
Warning: group `testuser3' has no more members.
103+
Done.
104+
Rule deleted
105+
Rule deleted (v6)
106+
Firewall stopped and disabled on system startup
107+
Reading package lists...
108+
Building dependency tree...
109+
Reading state information...
110+
The following packages will be REMOVED:
111+
libopts25* ntp*
112+
0 upgraded, 0 newly installed, 2 to remove and 15 not upgraded.
113+
After this operation, 1,791 kB disk space will be freed.
114+
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 57723 files and directories currently installed.)
115+
Removing ntp (1:4.2.8p4+dfsg-3ubuntu5.3) ...
116+
Purging configuration files for ntp (1:4.2.8p4+dfsg-3ubuntu5.3) ...
117+
Removing libopts25:amd64 (1:5.18.7-3) ...
118+
Processing triggers for man-db (2.7.5-1) ...
119+
Processing triggers for libc-bin (2.23-0ubuntu4) ...
120+
All unit tests passed.
121+
122+
123+
RESULTS: 13 tests passed. 0 tests failed. 13 tests total.
124+
Execution completed in 21 second(s)...
125+

‎tests/tests.sh

+20-125
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,32 @@
11
#!/bin/bash
22

3+
set -ex
4+
5+
####
6+
# Loop through all the Vagrantfiles in the /Vagrant dir and run the unit tests (unit-tests.sh) against them
7+
# Test results are stored in the /results dir
8+
###
9+
310
function getCurrentDir() {
411
local current_dir="${BASH_SOURCE%/*}"
512
if [[ ! -d "${current_dir}" ]]; then current_dir="$PWD"; fi
613
echo ${current_dir}
714
}
815

9-
current_dir=$(getCurrentDir)
10-
source "${current_dir}/lib/BashScriptTestingLibrary.shl"
11-
source "${current_dir}/../setupLibrary.sh"
12-
13-
test_user_account=testuser3
14-
test_account_password="123%pass_321"
15-
16-
### Unit Tests ###
17-
18-
function testSetup () {
19-
echo "Test Setup"
20-
addUserAccount ${test_user_account} ${test_account_password} true
21-
}
22-
23-
function testUserAccountCreated() {
24-
local user_exists_code=$(id -u ${test_user_account} > /dev/null 2>&1; echo $?)
25-
assertEquals 0 ${user_exists_code}
26-
}
27-
28-
function testIfUserIsSudo() {
29-
local user_access=$(sudo -l -U ${test_user_account})
30-
assertContains "(ALL : ALL) ALL" "${user_access}"
31-
}
32-
33-
function testAddingOfSSHKey() {
34-
disableSudoPassword
35-
36-
local dummy_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local"
37-
addSSHKey "${test_user_account}" "${dummy_key}"
16+
function runUnitTest() {
17+
local results_filename=${1}
3818

39-
local ssh_file="$(sudo cat /home/${test_user_account}/.ssh/authorized_keys)"
40-
assertEquals "${ssh_file}" "${dummy_key}"
19+
vagrant up
20+
vagrant ssh -c "cd /vagrant/tests; bash unit-tests.sh > results/${results_filename}.txt 2>&1"
21+
vagrant destroy -f
22+
rm -rf "Vagrantfile"
4123
}
4224

43-
function testChangeSSHConfig() {
44-
changeSSHConfig
45-
46-
local ssh_config="$(sudo cat /etc/ssh/sshd_config)"
47-
assertContains "PasswordAuthentication no" "${ssh_config}"
48-
assertContains "PermitRootLogin no" "${ssh_config}"
49-
}
50-
51-
function testUfw() {
52-
setupUfw
53-
54-
local ufw_status=$(sudo ufw status)
55-
assertContains "Status: active" "${ufw_status}"
56-
assertContains "OpenSSH" "${ufw_status}"
57-
}
58-
59-
function testSwap() {
60-
createSwap
61-
62-
assertContains "/swapfile" "$(ls -lh /swapfile)"
63-
assertContains "/swapfile" "$(sudo swapon --show)"
64-
}
65-
66-
function testSwapSettings() {
67-
local swappiness=$(cat /proc/sys/vm/swappiness)
68-
local cache_pressure=$(cat /proc/sys/vm/vfs_cache_pressure)
69-
70-
tweakSwapSettings 10 50
71-
72-
assertEquals "10" "$(cat /proc/sys/vm/swappiness)"
73-
assertEquals "50" "$(cat /proc/sys/vm/vfs_cache_pressure)"
74-
75-
tweakSwapSettings "${swappiness}" "${cache_pressure}"
76-
}
77-
78-
function testTimezone() {
79-
local timezone="$(cat /etc/timezone)"
80-
81-
setTimezone "America/New_York"
82-
assertEquals "America/New_York" "$(cat /etc/timezone)"
83-
setTimezone "${timezone}"
84-
}
85-
86-
function testNTP() {
87-
local timedatectl="$(timedatectl status)"
88-
89-
configureNTP
90-
assertContains "NTP synchronized: yes" "${timedatectl}"
91-
}
92-
93-
function testTeardown () {
94-
echo "Test Teardown"
95-
96-
deleteTestUser
97-
revertSudoers
98-
revertSSHConfig
99-
revertUfw
100-
deleteSwap
101-
102-
sudo apt-get --purge --assume-yes autoremove ntp
103-
}
104-
105-
### Helper Functions ###
106-
107-
function deleteTestUser() {
108-
sudo deluser ${test_user_account} sudo
109-
sudo deluser -f --remove-home ${test_user_account}
110-
}
111-
112-
function revertSudoers() {
113-
sudo cp /etc/sudoers.bak /etc/sudoers
114-
sudo rm -rf /etc/sudoers.bak
115-
}
116-
117-
function disableSudoPassword() {
118-
sudo cp /etc/sudoers /etc/sudoers.bak
119-
sudo bash -c "echo '${test_user_account} ALL=(ALL) NOPASSWD: ALL' | (EDITOR='tee -a' visudo)"
120-
}
121-
122-
function revertSSHConfig() {
123-
sudo cp /etc/ssh/sshd_config.old /etc/ssh/sshd_config
124-
sudo rm -rf /etc/ssh/sshd_config.old
125-
}
126-
127-
function revertUfw() {
128-
sudo ufw delete allow OpenSSH
129-
sudo ufw disable
130-
}
131-
132-
function deleteSwap() {
133-
sudo swapoff /swapfile
134-
sudo rm /swapfile
135-
}
25+
current_dir=$(getCurrentDir)
13626

137-
runUnitTests
27+
for file in "${current_dir}"/Vagrant/*; do
28+
filename=$(basename "${file}")
29+
cp "${current_dir}/Vagrant/${filename}" "${current_dir}/../Vagrantfile"
30+
cd "${current_dir}/../"
31+
runUnitTest "${filename}"
32+
done

‎tests/unit-tests.sh

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#!/bin/bash
2+
3+
function getCurrentDir() {
4+
local current_dir="${BASH_SOURCE%/*}"
5+
if [[ ! -d "${current_dir}" ]]; then current_dir="$PWD"; fi
6+
echo ${current_dir}
7+
}
8+
9+
current_dir=$(getCurrentDir)
10+
source "${current_dir}/lib/BashScriptTestingLibrary.shl"
11+
source "${current_dir}/../setupLibrary.sh"
12+
13+
test_user_account=testuser3
14+
test_account_password="123%pass_321"
15+
16+
### Unit Tests ###
17+
18+
function testSetup () {
19+
echo "Test Setup"
20+
addUserAccount ${test_user_account} ${test_account_password} true
21+
}
22+
23+
function testUserAccountCreated() {
24+
local user_exists_code=$(id -u ${test_user_account} > /dev/null 2>&1; echo $?)
25+
assertEquals 0 ${user_exists_code}
26+
}
27+
28+
function testIfUserIsSudo() {
29+
local user_access=$(sudo -l -U ${test_user_account})
30+
assertContains "(ALL : ALL) ALL" "${user_access}"
31+
}
32+
33+
function testAddingOfSSHKey() {
34+
disableSudoPassword
35+
36+
local dummy_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf localuser@machine.local"
37+
addSSHKey "${test_user_account}" "${dummy_key}"
38+
39+
local ssh_file="$(sudo cat /home/${test_user_account}/.ssh/authorized_keys)"
40+
assertEquals "${ssh_file}" "${dummy_key}"
41+
}
42+
43+
function testChangeSSHConfig() {
44+
changeSSHConfig
45+
46+
local ssh_config="$(sudo cat /etc/ssh/sshd_config)"
47+
assertContains "PasswordAuthentication no" "${ssh_config}"
48+
assertContains "PermitRootLogin no" "${ssh_config}"
49+
}
50+
51+
function testUfw() {
52+
setupUfw
53+
54+
local ufw_status=$(sudo ufw status)
55+
assertContains "Status: active" "${ufw_status}"
56+
assertContains "OpenSSH" "${ufw_status}"
57+
}
58+
59+
function testSwap() {
60+
createSwap
61+
62+
assertContains "/swapfile" "$(ls -lh /swapfile)"
63+
assertContains "/swapfile" "$(sudo swapon -s)"
64+
}
65+
66+
function testSwapSettings() {
67+
local swappiness=$(cat /proc/sys/vm/swappiness)
68+
local cache_pressure=$(cat /proc/sys/vm/vfs_cache_pressure)
69+
70+
tweakSwapSettings 10 50
71+
72+
assertEquals "10" "$(cat /proc/sys/vm/swappiness)"
73+
assertEquals "50" "$(cat /proc/sys/vm/vfs_cache_pressure)"
74+
75+
tweakSwapSettings "${swappiness}" "${cache_pressure}"
76+
}
77+
78+
function testTimezone() {
79+
local timezone="$(cat /etc/timezone)"
80+
81+
setTimezone "America/New_York"
82+
assertEquals "America/New_York" "$(cat /etc/timezone)"
83+
setTimezone "${timezone}"
84+
}
85+
86+
function testNTP() {
87+
configureNTP
88+
assertContains "NTP synchronized: yes" "$(timedatectl status)"
89+
}
90+
91+
function testTeardown () {
92+
echo "Test Teardown"
93+
94+
deleteTestUser
95+
revertSudoers
96+
revertSSHConfig
97+
revertUfw
98+
deleteSwap
99+
100+
sudo apt-get --purge --assume-yes autoremove ntp
101+
}
102+
103+
### Helper Functions ###
104+
105+
function deleteTestUser() {
106+
sudo deluser ${test_user_account} sudo
107+
sudo deluser -f --remove-home ${test_user_account}
108+
}
109+
110+
function revertSudoers() {
111+
sudo cp /etc/sudoers.bak /etc/sudoers
112+
sudo rm -rf /etc/sudoers.bak
113+
}
114+
115+
function disableSudoPassword() {
116+
sudo cp /etc/sudoers /etc/sudoers.bak
117+
sudo bash -c "echo '${test_user_account} ALL=(ALL) NOPASSWD: ALL' | (EDITOR='tee -a' visudo)"
118+
}
119+
120+
function revertSSHConfig() {
121+
sudo cp /etc/ssh/sshd_config.old /etc/ssh/sshd_config
122+
sudo rm -rf /etc/ssh/sshd_config.old
123+
}
124+
125+
function revertUfw() {
126+
sudo ufw delete allow OpenSSH
127+
sudo ufw disable
128+
}
129+
130+
function deleteSwap() {
131+
sudo swapoff /swapfile
132+
sudo rm /swapfile
133+
}
134+
135+
runUnitTests

0 commit comments

Comments
 (0)
Please sign in to comment.