PDQTest runs on Linux/MAC and Windows systems, with the caveat that:
- Windows acceptance tests can only be run on Windows
- Linux acceptance tests can only run on Linux If you are using Windows and want to test Linux modules, the easiest way for you to run PDQTest is to install virtualisation software and then use Vagrant to create a VM that shares a filesystem with your main Windows desktop. This will allow you to edit your puppet code as you please and have it instantly show up inside of a Linux VM where you can run PDQTest and Docker.
Do NOT run PDQTest on a managed Puppet node, you may damage the agent
- Install Ruby - you will need a fairly new version of Ruby as Puppet requires
this. On linux you will probably need development libraries, eg
yum groupinstall 'Development Tools'
. Once ruby is installed follow any additional setup steps to activate the environment and then check it really worked by runningruby --version
before proceeding. Note thatpdqtest
should not be run asroot
. Easy ways to install an up-to-date Ruby: - Make sure
git
is installed -yum install git
- Install the PDK OS package
- Install PDQTest -
gem install pdqtest
- Install bundler (the only sane way to manage Ruby dependencies)
gem install bundler
7 Add PDK to your path (add to.profile
for permanent):export PATH=/opt/puppetlabs/pdk/bin/:$PATH
- Install Docker CE
- Start the
docker
daemon and make sure the user your running as is in thedocker
group. You will need to log out and back in again after doing this - Install the PDQTest docker images by typing
pdqtest setup
UNTESTED! Do you own a mac? Please let me know what works
Instructions should be as Linux, but from memory, I had to run:
eval "$(docker-machine env default)"
to configure the shell last time I owned a mac. If things have moved on since then, let me know what else is needed (possibly including a patch)
You will need to reboot/restart powershell several times
- You will need Windows 10 (Windows 10 Enterprise, Professional, or Education)
and the system your running on must enable
VTx
which is needed for
Windows containers
running under
Hyper-V
which we use for testing:
- Laptops/Desktops - enable VTx in BIOS/UEFI
- VMs - You must run under VMWare and enable VTx in VM settings (as well as enabling on the host)
- Make sure to allocate plenty of CPU and memory
- Enable Hyper-V (The Hyper-V role cannot be installed on Windows 10 Home) -
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All -Verbose
- Install Chocolatey
- Install Docker for Windows -
choco install docker-for-windows
- Enable windows containers
- Enable localhost access to Docker API
"hosts": ["tcp://127.0.0.1:2375"]
- Install Ruby 2.4 (Ruby 2.5 doesn't work yet
PDK-1171):
choco install ruby --version 2.4.3.1
- Install PDK:
choco install pdk
- Install PDQTest -
gem install pdqtest
- Install bundler
gem install bundler
- Enable running scripts -
Set-ExecutionPolicy -ExecutionPolicy unrestricted
Be sure to read the Windows notes for guidance on how to run tests on Windows