Skip to content

Commit bea78ba

Browse files
committed
Add VM README
1 parent c325873 commit bea78ba

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/support/vm/openldap/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Local OpenLDAP Integration Testing
2+
3+
Set up a [Vagrant](http://www.vagrantup.com/) VM to run tests against OpenLDAP locally.
4+
5+
To run tests against OpenLDAP (instead of ApacheDS) locally:
6+
7+
``` bash
8+
# start VM (from the correct directory)
9+
$ cd test/support/vm/openldap/
10+
$ vagrant up
11+
12+
# get the IP address of the VM
13+
$ ip=$(vagrant ssh -- "ifconfig eth1 | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1")
14+
15+
# change back to root project directory
16+
$ cd ../../../..
17+
18+
# run all tests against OpenLDAP
19+
$ time TESTENV=openldap OPENLDAP_HOST=$ip bundle exec rake
20+
21+
# run a specific test file against OpenLDAP
22+
$ time TESTENV=openldap OPENLDAP_HOST=$ip bundle exec ruby test/membership_validators/recursive_test.rb
23+
24+
# run OpenLDAP tests by default
25+
$ export TESTENV=openldap
26+
$ export TESTENV=$ip
27+
28+
# now run tests without having to set ENV variables
29+
$ time bundle exec rake
30+
```
31+
32+
You may need to `gem install vagrant` first in order to provision the VM.

0 commit comments

Comments
 (0)