summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-08-24 16:29:23 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-08-24 19:45:21 (GMT)
commit5a19f3167b640966c582e52abe4b55ef20bd79b2 (patch)
treecb432296b34b1b90501cca8090a48bb1466fcfd6 /QA/CrossDistributionTest/playbook.yml
parent759ba1615226ad223b118533188ba55d8bc88ce0 (diff)
downloadswift-5a19f3167b640966c582e52abe4b55ef20bd79b2.zip
swift-5a19f3167b640966c582e52abe4b55ef20bd79b2.tar.bz2
Add script to test Swift compilation across Linux distributions
This adds the VagrantCrossDistributionTest.py script. The script allows testing the BuildTools/InstallSwiftDependencies.sh script, Swift compilation and the unit tests across different OSs. It is based on Vagrant, used publicly available VM boxes of different Linux distributions, uses Ansible to prepare the environment for compilation and finally installs the build dependencies, builds Swift and runs the unit tests. Test-Information: Ran the script on OS X 10.11.6 with Vagrant 1.8.5. It successfully build Swift and ran the tests on Ubuntu 16.04, Ubuntu 15.04, Debian 8.5, OpenSUSE Leap 42.1 and Fedora 24. Change-Id: I78e196f1a97a4fe2b5c9224f4ba19f6c7bdee03a
Diffstat (limited to 'QA/CrossDistributionTest/playbook.yml')
-rw-r--r--QA/CrossDistributionTest/playbook.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/QA/CrossDistributionTest/playbook.yml b/QA/CrossDistributionTest/playbook.yml
new file mode 100644
index 0000000..bad4d30
--- /dev/null
+++ b/QA/CrossDistributionTest/playbook.yml
@@ -0,0 +1,31 @@
+- hosts: all
+ tasks:
+ - name: Install required packages via apt
+ apt: name=git state=latest update_cache=yes
+ become: true
+ when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
+ - name: Install required packages via dnf
+ dnf: name={{item}} state=latest
+ with_items:
+ - git
+ - redhat-lsb
+ become: true
+ when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' or ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora'
+ - name: 'Install required packages via zypper'
+ zypper: name={{item}} state=latest
+ with_items:
+ - git-core
+ - lsb-release
+ become: true
+ when: ansible_distribution == 'openSUSE Leap'
+ - name: Clone git from host working directory
+ git: repo=/home/vagrant/swift-host dest=/home/vagrant/swift
+
+ - name: 'Install Swift dependencies'
+ shell: ./BuildTools/InstallSwiftDependencies.sh --non-interactive chdir=/home/vagrant/swift
+ become: true
+ when: ansible_distribution == 'openSUSE Leap'
+ - name: 'Install Swift dependencies'
+ shell: yes | ./BuildTools/InstallSwiftDependencies.sh chdir=/home/vagrant/swift
+ become: true
+ when: ansible_distribution != 'openSUSE Leap'