|
52 | 52 | it 'sets the allowedOptions flag correctly' do
|
53 | 53 | tpl_output = template.render(manifest_properties, consumes: mapfs_link)
|
54 | 54 |
|
55 |
| - expect(tpl_output).to include("export LDAP_SVC_USER=\"service-user\"") |
56 |
| - expect(tpl_output).to include("export LDAP_SVC_PASS=\"service-password\"") |
| 55 | + expect(tpl_output).to include("export LDAP_SVC_USER='service-user'") |
| 56 | + expect(tpl_output).to include("export LDAP_SVC_PASS='service-password'") |
57 | 57 | expect(tpl_output).to include("export LDAP_HOST=\"some-host\"")
|
58 | 58 | expect(tpl_output).to include("export LDAP_PORT=\"1234\"")
|
59 | 59 | expect(tpl_output).to include("export LDAP_PROTO=\"udp\"")
|
|
62 | 62 | end
|
63 | 63 | end
|
64 | 64 |
|
| 65 | + context 'when ldap properties contain bash special characters' do |
| 66 | + let(:manifest_properties) do |
| 67 | + { |
| 68 | + "nfsv3driver" => { |
| 69 | + "ldap_svc_user" => "Patrick O'Malley", |
| 70 | + "ldap_svc_password" => "!que&pasa!${xxx}$?", |
| 71 | + "ldap_host" => "some-host", |
| 72 | + "ldap_port" => 1234, |
| 73 | + "ldap_proto" => "udp", |
| 74 | + "ldap_user_fqdn" => "cn=Users,dc=corp,dc=test,dc=com", |
| 75 | + "ldap_ca_cert" => "some-ca-cert", |
| 76 | + } |
| 77 | + } |
| 78 | + end |
| 79 | + |
| 80 | + it 'escapes the properties correctly' do |
| 81 | + tpl_output = template.render(manifest_properties, consumes: mapfs_link) |
| 82 | + |
| 83 | + expect(tpl_output).to include("export LDAP_SVC_USER='Patrick O'\"'\"'Malley'") |
| 84 | + expect(tpl_output).to include("export LDAP_SVC_PASS='!que&pasa!${xxx}$?'") |
| 85 | + end |
| 86 | + end |
65 | 87 | context 'when configured with ldap with a null ca cert' do
|
66 | 88 | let(:manifest_properties) do
|
67 | 89 | {
|
|
0 commit comments