From 91adedd7e480dfc7e30ff6777c513e2c246f9a89 Mon Sep 17 00:00:00 2001 From: Matt Todd Date: Fri, 17 Oct 2014 15:00:48 -0700 Subject: [PATCH 1/3] Allow configurable OpenLDAP host (for local runs) --- test/test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 8e4b6e9..7780371 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -71,7 +71,7 @@ def options instrumentation_service: @service when "openldap" { - host: 'localhost', + host: ENV.fetch("OPENLDAP_HOST", "localhost"), port: 389, admin_user: 'uid=admin,dc=github,dc=com', admin_password: 'passworD1', From c325873f51c0f3ee9f8c6063676e9ce418679e37 Mon Sep 17 00:00:00 2001 From: Matt Todd Date: Fri, 17 Oct 2014 15:01:23 -0700 Subject: [PATCH 2/3] Add Vagrantfile for running OpenLDAP tests --- test/support/vm/openldap/.gitignore | 1 + test/support/vm/openldap/Vagrantfile | 33 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/support/vm/openldap/.gitignore create mode 100644 test/support/vm/openldap/Vagrantfile diff --git a/test/support/vm/openldap/.gitignore b/test/support/vm/openldap/.gitignore new file mode 100644 index 0000000..dace708 --- /dev/null +++ b/test/support/vm/openldap/.gitignore @@ -0,0 +1 @@ +/.vagrant diff --git a/test/support/vm/openldap/Vagrantfile b/test/support/vm/openldap/Vagrantfile new file mode 100644 index 0000000..3bb3981 --- /dev/null +++ b/test/support/vm/openldap/Vagrantfile @@ -0,0 +1,33 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.hostname = "openldap.github.org" + + config.vm.box = "hashicorp/precise64" + + config.vm.network "private_network", type: :dhcp + + config.ssh.forward_agent = true + + config.vm.provision "shell", inline: "apt-get update; exec env /vagrant_data/script/install-openldap" + + config.vm.synced_folder "../../../..", "/vagrant_data" + + config.vm.provider "vmware_fusion" do |vb, override| + override.vm.box = "hashicorp/precise64" + vb.memory = 4596 + vb.vmx["displayname"] = "integration tests vm" + vb.vmx["numvcpus"] = "2" + end + + config.vm.provider "virtualbox" do |vb, override| + vb.memory = 4096 + vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] + vb.customize ["modifyvm", :id, "--chipset", "ich9"] + vb.customize ["modifyvm", :id, "--vram", "16"] + end +end From bea78ba08461ffe26ebf7e7a6587c85f767954a3 Mon Sep 17 00:00:00 2001 From: Matt Todd Date: Fri, 17 Oct 2014 15:03:57 -0700 Subject: [PATCH 3/3] Add VM README --- test/support/vm/openldap/README.md | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/support/vm/openldap/README.md diff --git a/test/support/vm/openldap/README.md b/test/support/vm/openldap/README.md new file mode 100644 index 0000000..67a4ded --- /dev/null +++ b/test/support/vm/openldap/README.md @@ -0,0 +1,32 @@ +# Local OpenLDAP Integration Testing + +Set up a [Vagrant](http://www.vagrantup.com/) VM to run tests against OpenLDAP locally. + +To run tests against OpenLDAP (instead of ApacheDS) locally: + +``` bash +# start VM (from the correct directory) +$ cd test/support/vm/openldap/ +$ vagrant up + +# get the IP address of the VM +$ ip=$(vagrant ssh -- "ifconfig eth1 | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1") + +# change back to root project directory +$ cd ../../../.. + +# run all tests against OpenLDAP +$ time TESTENV=openldap OPENLDAP_HOST=$ip bundle exec rake + +# run a specific test file against OpenLDAP +$ time TESTENV=openldap OPENLDAP_HOST=$ip bundle exec ruby test/membership_validators/recursive_test.rb + +# run OpenLDAP tests by default +$ export TESTENV=openldap +$ export TESTENV=$ip + +# now run tests without having to set ENV variables +$ time bundle exec rake +``` + +You may need to `gem install vagrant` first in order to provision the VM. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy