Permalink
Browse files

Merge "fix mongodb unit test for new bind_mount scheme"

  • Loading branch information...
2 parents bd446a7 + 575d17d commit 421b082c963ec8c17fa17f642c32bb73ec99b5c3 @SlimYang SlimYang committed with Gerrit Code Review Dec 7, 2012
Showing with 46 additions and 33 deletions.
  1. +15 −14 ng/mongodb/config/mongodb_node.yml
  2. +31 −19 ng/mongodb/spec/spec_helper.rb
@@ -10,31 +10,32 @@ logging:
level: debug
service_log_dir: /var/vcap/sys/log/mongodb
service_bin_dir:
- "1.8": /usr/bin
- "2.0": /usr/bin
- "2.2": /usr/bin
-service_script_dir: /usr/bin
-service_conf_dir: /etc
+ "1.8": /var/vcap/packages/mongodb18
+ "2.0": /var/vcap/packages/mongodb20
+ "2.2": /var/vcap/packages/mongodb22
+ "proxy": /var/vcap/packages/mongodb_proxy
+service_script_dir: /var/vcap/jobs/mongodb_node_ng/bin
+service_conf_dir: /var/vcap/jobs/mongodb_node_ng/config
pid: /var/vcap/sys/run/mongodb_node.pid
node_id: mongodb_node_free_1
supported_versions: ["1.8", "2.0", "2.2"]
default_version: "2.0"
mongod_path:
- "1.8": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-1.8/mongod"
- "2.0": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.0/mongod"
- "2.2": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.2/mongod"
+ "1.8": "/var/vcap/packages/mongodb18/bin/mongod"
+ "2.0": "/var/vcap/packages/mongodb20/bin/mongod"
+ "2.2": "/var/vcap/packages/mongodb22/bin/mongod"
mongorestore_path:
- "1.8": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-1.8/mongorestore"
- "2.0": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.0/mongorestore"
- "2.2": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.2/mongorestore"
+ "1.8": "/var/vcap/packages/mongodb18/bin/mongorestore"
+ "2.0": "/var/vcap/packages/mongodb20/bin/mongorestore"
+ "2.2": "/var/vcap/packages/mongodb22/bin/mongorestore"
mongodump_path:
- "1.8": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-1.8/mongodump"
- "2.0": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.0/mongodump"
- "2.2": "/tmp/warden/rootfs/usr/share/mongodb/mongodb-2.2/mongodump"
+ "1.8": "/var/vcap/packages/mongodb18/bin/mongorestore"
+ "2.0": "/var/vcap/packages/mongodb20/bin/mongorestore"
+ "2.2": "/var/vcap/packages/mongodb22/bin/mongorestore"
mongod_options:
"1.8": ""
@@ -113,27 +113,39 @@ def get_node_config()
config = YAML.load_file(config_file)
mongodb_conf_template = File.join(PWD, "../resources/mongodb.conf.erb")
options = {
- :logger => Logger.new(parse_property(config, "log_file", String, :optional => true) || STDOUT, "daily"),
- :plan => parse_property(config, "plan", String),
- :capacity => parse_property(config, "capacity", Integer),
- :mongod_path => parse_property(config, "mongod_path", Hash),
- :mongod_options => parse_property(config, "mongod_options", Hash),
- :mongorestore_path => parse_property(config, "mongorestore_path", Hash),
- :mongodump_path => parse_property(config, "mongodump_path", Hash),
- :ip_route => parse_property(config, "ip_route", String, :optional => true),
- :node_id => parse_property(config, "node_id", String),
- :mbus => parse_property(config, "mbus", String),
- :config_template => mongodb_conf_template,
- :port_range => parse_property(config, "port_range", Range),
+ # miscellaneous configs
+ :logger => Logger.new(parse_property(config, "log_file", String, :optional => true) || STDOUT, "daily"),
+ :plan => parse_property(config, "plan", String),
+ :capacity => parse_property(config, "capacity", Integer),
+ :ip_route => parse_property(config, "ip_route", String, :optional => true),
+ :node_id => parse_property(config, "node_id", String),
+ :mbus => parse_property(config, "mbus", String),
+ :port_range => parse_property(config, "port_range", Range),
:max_clients => parse_property(config, "max_clients", Integer, :optional => true),
- :base_dir => '/tmp/mongo/instances',
+
+ # parse mongodb wardenized-service control related config
+ :service_script_dir => parse_property(config, "service_script_dir", String),
+ :service_bin_dir => parse_property(config, "service_bin_dir", Hash),
+ :service_conf_dir => parse_property(config, "service_conf_dir", String),
+
+ # mongodb instances related configs
+ :config_template => mongodb_conf_template,
+ :supported_versions => parse_property(config, "supported_versions", Array),
+ :default_version => parse_property(config, "default_version", String),
+ :service_start_timeout => parse_property(config, "service_start_timeout", Integer),
+
+ # hardcode unit test related directories to /tmp dir
+ :base_dir => '/tmp/mongo/instances',
:service_log_dir => '/tmp/mongo/logs',
- :local_db => 'sqlite3:/tmp/mongo/mongodb_node.db',
- :image_dir => '/tmp/mongo/images',
- :max_disk => 128,
- :supported_versions => parse_property(config, "supported_versions", Array),
- :default_version => parse_property(config, "default_version", String),
- :service_start_timeout => parse_property(config, "service_start_timeout", Integer)
+ :local_db => 'sqlite3:/tmp/mongo/mongodb_node.db',
+ :image_dir => '/tmp/mongo/images',
+ :max_disk => 128,
+
+ # parse mongodb binary related config
+ :mongod_path => parse_property(config, "mongod_path", Hash),
+ :mongod_options => parse_property(config, "mongod_options", Hash),
+ :mongorestore_path => parse_property(config, "mongorestore_path", Hash),
+ :mongodump_path => parse_property(config, "mongodump_path", Hash),
}
options[:logger].level = Logger::DEBUG
options

0 comments on commit 421b082

Please sign in to comment.