net-ldap 0.16.1 → 0.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +216 -246
  5. data/.travis.yml +27 -3
  6. data/CONTRIBUTING.md +1 -1
  7. data/History.rdoc +7 -0
  8. data/README.rdoc +10 -5
  9. data/Rakefile +1 -1
  10. data/lib/net/ber/core_ext.rb +6 -6
  11. data/lib/net/ber.rb +2 -2
  12. data/lib/net/ldap/auth_adapter/gss_spnego.rb +2 -2
  13. data/lib/net/ldap/auth_adapter/sasl.rb +1 -1
  14. data/lib/net/ldap/auth_adapter/simple.rb +1 -1
  15. data/lib/net/ldap/connection.rb +8 -4
  16. data/lib/net/ldap/dataset.rb +2 -2
  17. data/lib/net/ldap/dn.rb +10 -10
  18. data/lib/net/ldap/entry.rb +1 -1
  19. data/lib/net/ldap/error.rb +1 -0
  20. data/lib/net/ldap/filter.rb +10 -3
  21. data/lib/net/ldap/instrumentation.rb +2 -2
  22. data/lib/net/ldap/password.rb +3 -5
  23. data/lib/net/ldap/pdu.rb +1 -1
  24. data/lib/net/ldap/version.rb +1 -1
  25. data/lib/net/ldap.rb +14 -14
  26. data/lib/net/snmp.rb +1 -1
  27. data/lib/net-ldap.rb +1 -1
  28. data/net-ldap.gemspec +4 -4
  29. data/script/ldap-docker +12 -0
  30. data/test/ber/test_ber.rb +1 -1
  31. data/test/fixtures/ca/docker-ca.pem +18 -0
  32. data/test/fixtures/{openldap/retcode.ldif → ldif/06-retcode.ldif} +7 -8
  33. data/test/fixtures/ldif/50-seed.ldif +374 -0
  34. data/test/integration/test_add.rb +1 -3
  35. data/test/integration/test_ber.rb +2 -2
  36. data/test/integration/test_bind.rb +12 -35
  37. data/test/integration/test_delete.rb +1 -3
  38. data/test/integration/test_open.rb +10 -11
  39. data/test/integration/test_password_modify.rb +19 -19
  40. data/test/integration/test_return_codes.rb +12 -4
  41. data/test/integration/test_search.rb +8 -8
  42. data/test/test_dn.rb +2 -3
  43. data/test/test_entry.rb +3 -2
  44. data/test/test_filter_parser.rb +5 -0
  45. data/test/test_helper.rb +6 -7
  46. data/test/test_ldap.rb +5 -5
  47. data/test/test_ldap_connection.rb +46 -32
  48. data/test/test_ldif.rb +12 -12
  49. data/test/test_password.rb +2 -2
  50. data/test/test_snmp.rb +4 -5
  51. data/test/test_ssl_ber.rb +7 -3
  52. data/testserver/ldapserver.rb +13 -22
  53. metadata +34 -48
  54. data/script/generate-fixture-ca +0 -48
  55. data/script/install-openldap +0 -134
  56. data/test/fixtures/ca/ca.info +0 -4
  57. data/test/fixtures/ca/cacert.pem +0 -24
  58. data/test/fixtures/ca/cakey.pem +0 -190
  59. data/test/fixtures/openldap/memberof.ldif +0 -33
  60. data/test/fixtures/openldap/slapd.conf.ldif +0 -67
  61. data/test/fixtures/seed.ldif +0 -374
  62. data/test/support/vm/openldap/README.md +0 -64
  63. data/test/support/vm/openldap/Vagrantfile +0 -34
@@ -1,64 +0,0 @@
1
- # Local OpenLDAP Integration Testing
2
-
3
- Set up a [Vagrant](http://www.vagrantup.com/) VM to run integration
4
- tests against OpenLDAP locally. *NOTE*: To support some of the SSL tests,
5
- Vagrant forwards localhost port 9389 to VM host port 9389. The port mapping
6
- goes away when you run `vagrant destroy`.
7
-
8
- ## Install Vagrant
9
-
10
- *NOTE*: The Vagrant gem (`gem install vagrant`) is
11
- [no longer supported](https://www.vagrantup.com/docs/installation/). If you've
12
- previously installed it, run `gem uninstall vagrant`. If you're an rbenv
13
- user, you probably want to follow that up with `rbenv rehash; hash -r`.
14
-
15
- If you use Homebrew on macOS:
16
- ``` bash
17
- $ brew update
18
- $ brew cask install virtualbox
19
- $ brew cask install vagrant
20
- $ brew cask install vagrant-manager
21
- $ vagrant plugin install vagrant-vbguest
22
- ```
23
-
24
- Installing Vagrant and virtualbox on other operating systems is left
25
- as an exercise to the reader. Note the `vagrant-vbguest` plugin is required
26
- to update the VirtualBox guest extensions in the guest VM image.
27
-
28
- ## Run the tests
29
-
30
- ``` bash
31
- # start VM (from the correct directory)
32
- $ cd test/support/vm/openldap/
33
- $ vagrant up
34
-
35
- # get the IP address of the VM
36
- $ ip=$(vagrant ssh -- "ifconfig eth1 | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1")
37
-
38
- # change back to root project directory
39
- $ cd ../../../..
40
-
41
- # set the TCP port for testing
42
- $ export INTEGRATION_PORT=9389
43
-
44
- # run all tests, including integration tests
45
- $ time INTEGRATION=openldap INTEGRATION_HOST=$ip bundle exec rake
46
-
47
- # run a specific integration test file
48
- $ time INTEGRATION=openldap INTEGRATION_HOST=$ip bundle exec ruby test/integration/test_search.rb
49
-
50
- # run integration tests by default
51
- $ export INTEGRATION=openldap
52
- $ export INTEGRATION_HOST=$ip
53
-
54
- # now run tests without having to set ENV variables
55
- $ time bundle exec rake
56
-
57
- # Once you're all done
58
- $ cd test/support/vm/openldap
59
- $ vagrant destroy
60
- ```
61
-
62
- If at any point your VM appears to have broken itself, `vagrant destroy`
63
- from the `test/support/vm/openldap` directory will blow it away. You can
64
- then do `vagrant up` and start over.
@@ -1,34 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
- VAGRANTFILE_API_VERSION = "2"
6
-
7
- Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
- config.vm.hostname = "rubyldap.com"
9
-
10
- config.vm.box = "hashicorp/precise64"
11
-
12
- config.vm.network "private_network", type: :dhcp
13
- config.vm.network "forwarded_port", guest: 389, host: 9389
14
-
15
- config.ssh.forward_agent = true
16
-
17
- config.vm.provision "shell", inline: "apt-get update; exec env /vagrant_data/script/install-openldap"
18
-
19
- config.vm.synced_folder "../../../..", "/vagrant_data"
20
-
21
- config.vm.provider "vmware_fusion" do |vb, override|
22
- override.vm.box = "hashicorp/precise64"
23
- vb.memory = 4596
24
- vb.vmx["displayname"] = "integration tests vm"
25
- vb.vmx["numvcpus"] = "2"
26
- end
27
-
28
- config.vm.provider "virtualbox" do |vb, override|
29
- vb.memory = 4096
30
- vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
31
- vb.customize ["modifyvm", :id, "--chipset", "ich9"]
32
- vb.customize ["modifyvm", :id, "--vram", "16"]
33
- end
34
- end