Skip to content

Latest commit

 

History

History
81 lines (72 loc) · 4.04 KB

installation.md

File metadata and controls

81 lines (72 loc) · 4.04 KB

Installation

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

Linux Instructions

  1. 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 running ruby --version before proceeding. Note that pdqtest should not be run as root. Easy ways to install an up-to-date Ruby:
  2. Make sure git is installed - yum install git
  3. Install the PDK OS package
  4. Install PDQTest - gem install pdqtest
  5. 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
  6. Install Docker CE
  7. Start the docker daemon and make sure the user your running as is in the docker group. You will need to log out and back in again after doing this
  8. Install the PDQTest docker images by typing pdqtest setup

Mac instructions

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)

Windows Instructions

You will need to reboot/restart powershell several times

  1. 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
  2. Enable Hyper-V (The Hyper-V role cannot be installed on Windows 10 Home) - Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All -Verbose
  3. Install Chocolatey
  4. Install Docker for Windows - choco install docker-for-windows
  5. Enable windows containers
  6. Enable localhost access to Docker API
    "hosts": ["tcp://127.0.0.1:2375"]
  7. Install Ruby 2.4 (Ruby 2.5 doesn't work yet PDK-1171): choco install ruby --version 2.4.3.1
  8. Install PDK: choco install pdk
  9. Install PDQTest - gem install pdqtest
  10. Install bundler gem install bundler
  11. Enable running scripts - Set-ExecutionPolicy -ExecutionPolicy unrestricted

Be sure to read the Windows notes for guidance on how to run tests on Windows