forked from flapjack/flapjack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# top level | ||
[notifier] | ||
notifier-directories = /usr/lib/flapjack/notifiers/ /path/to/my/notifiers | ||
notifiers = mailer, xmpp | ||
|
||
[persistence] | ||
backend = couchdb | ||
host = localhost | ||
port = 5984 | ||
username = spoons | ||
password = doom | ||
|
||
[transport] | ||
backend = beanstalkd | ||
basedir = /usr/lib/flapjack/persistence/ | ||
host = localhost | ||
port = 11300 | ||
|
||
[mailer-notifier] | ||
from_address = [email protected] | ||
|
||
[xmpp-notifier] | ||
jid = [email protected] | ||
password = barfoo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# top level | ||
[notifier] | ||
notifier-directories = /usr/lib/flapjack/notifiers/ /path/to/my/notifiers | ||
notifiers = mailer, xmpp | ||
|
||
# persistence layers | ||
[persistence] | ||
backend = datamapper | ||
uri = sqlite3:///tmp/flapjack.db | ||
|
||
# message transports | ||
[transport] | ||
backend = beanstalkd | ||
basedir = /usr/lib/flapjack/persistence/ | ||
host = localhost | ||
port = 11300 | ||
|
||
# notifiers | ||
[mailer-notifier] | ||
from_address = [email protected] | ||
|
||
[xmpp-notifier] | ||
jid = [email protected] | ||
password = barfoo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# recipients | ||
|
||
[John Doe] | ||
email = [email protected] | ||
jid = [email protected] | ||
phone = +61 400 111 222 | ||
pager = 61400111222 | ||
|
||
[Jane Doe] | ||
email = [email protected] | ||
jid = [email protected] | ||
phone = +61 222 333 111 | ||
pager = 61222333111 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier') | ||
|
||
describe "notifier options multiplexer" do | ||
|
||
before(:all) do | ||
@config_filename = File.join(File.dirname(__FILE__), 'configs', 'flapjack-notifier.ini') | ||
@recipients_filename = File.join(File.dirname(__FILE__), 'configs', 'recipients.ini') | ||
|
||
@couchdb_config_filename = File.join(File.dirname(__FILE__), 'configs', 'flapjack-notifier-couchdb.ini') | ||
end | ||
|
||
it "should setup notifier options from specified config file" do | ||
args = ["-c", @config_filename, "-r", @recipients_filename] | ||
config = Flapjack::Notifier::Options.parse(args) | ||
config.notifiers.each do |notifier| | ||
%w(mailer xmpp).include?(notifier.keys.first) | ||
end | ||
|
||
config.notifier_directories.each do |dir| | ||
%w(/usr/lib/flapjack/notifiers/ /path/to/my/notifiers).include?(dir) | ||
end | ||
end | ||
|
||
it "should setup beanstalkd transport options from specified config file" do | ||
args = ["-c", @config_filename, "-r", @recipients_filename] | ||
config = Flapjack::Notifier::Options.parse(args) | ||
config.transport.backend.should == "beanstalkd" | ||
config.transport.host.should == "localhost" | ||
config.transport.port.should == "11300" | ||
end | ||
|
||
it "should setup datamapper persistence options from specified config file" do | ||
args = ["-c", @config_filename, "-r", @recipients_filename] | ||
config = Flapjack::Notifier::Options.parse(args) | ||
config.persistence.backend.should == "datamapper" | ||
config.persistence.uri.should == "sqlite3:///tmp/flapjack.db" | ||
end | ||
|
||
it "should setup couchdb persistence backend from specified config file" do | ||
args = [ "-c", @couchdb_config_filename, "-r", @recipients_filename ] | ||
config = Flapjack::Notifier::Options.parse(args) | ||
config.persistence.backend.should == "couchdb" | ||
config.persistence.host.should == "localhost" | ||
config.persistence.port.should == "5984" | ||
config.persistence.username.should == "spoons" | ||
config.persistence.password.should == "doom" | ||
end | ||
|
||
end | ||
|
||
|