Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
Updates password matching regex in ServerSpec tests
Browse files Browse the repository at this point in the history
We've been incrementally refining the regex that matches the
automatically generated passwords and secrets used for auth between the
service components. Haven't see a definitive declaration of allowed
characters there, so adding narrow exceptions when tests fail with
known-working combinations generated by the jitsi setup scripts.
  • Loading branch information
Conor Schaefer committed Nov 17, 2016
1 parent 5aefbbb commit 2b633b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions spec/jicofo_spec.rb
Expand Up @@ -9,8 +9,10 @@
its('content') { should match(/^JICOFO_PORT=5347$/) }
# The regex for the "secret" may be off. Tests have failed before
# when matching only '\w', due to a '@', so adding that.
its('content') { should match(/^JICOFO_SECRET=[\w@]{8,}$/) }
its('content') { should match(/^JICOFO_AUTH_PASSWORD=\w{8,}$/) }
# Also have seen '#', so adding that. Would love a definitive
# take on which characters are allowed here.
its('content') { should match(/^JICOFO_SECRET=[\w@#]{8,}$/) }
its('content') { should match(/^JICOFO_AUTH_PASSWORD=[\w@#]{8,}$/) }
its('content') { should match(/^JICOFO_AUTH_USER=focus$/) }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/prosody_spec.rb
Expand Up @@ -56,7 +56,7 @@
it { should be_owned_by 'prosody' }
it { should be_grouped_into 'prosody' }
its('mode') { should eq '640' }
regexp = /^\s+\["password"\] = "\w+";$/
regexp = /^\s+\["password"\] = "[\w@#]+";$/
its('content') { should match(regexp) }
end
end

0 comments on commit 2b633b5

Please sign in to comment.