diff --git a/spec/classes/cassandra_spec.rb b/spec/classes/cassandra_spec.rb index 6127ded7..5472d69f 100644 --- a/spec/classes/cassandra_spec.rb +++ b/spec/classes/cassandra_spec.rb @@ -89,6 +89,96 @@ it { should contain_file('/etc/cassandra/cassandra.yaml').with_content(/#auto_bootstrap: true/) } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/batchlog_replay_throttle_in_kb: 1024/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/cas_contention_timeout_in_ms: 1000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/column_index_size_in_kb: 64/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/commit_failure_policy: stop/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/compaction_throughput_mb_per_sec: 16/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/counter_cache_save_period: 7200/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/counter_write_request_timeout_in_ms: 5000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/cross_node_timeout: false/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/dynamic_snitch_badness_threshold: 0.1/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/dynamic_snitch_reset_interval_in_ms: 600000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/dynamic_snitch_update_interval_in_ms: 100/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/hinted_handoff_throttle_in_kb: 1024/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/index_summary_resize_interval_in_minutes: 60/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/inter_dc_tcp_nodelay: false/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/max_hints_delivery_threads: 2/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/max_hint_window_in_ms: 10800000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/permissions_validity_in_ms: 2000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/range_request_timeout_in_ms: 10000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/read_request_timeout_in_ms: 5000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/request_scheduler: org.apache.cassandra.scheduler.NoScheduler/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/request_timeout_in_ms: 10000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/row_cache_save_period: 0/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/row_cache_size_in_mb: 0/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/sstable_preemptive_open_interval_in_mb: 50/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/tombstone_failure_threshold: 100000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/tombstone_warn_threshold: 1000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/trickle_fsync: false/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/trickle_fsync_interval_in_kb: 10240/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/truncate_request_timeout_in_ms: 60000/) + } + it { + should contain_file('/etc/cassandra/cassandra.yaml').with_content(/write_request_timeout_in_ms: 2000/) + } it { should contain_ini_setting('rackdc.properties.dc').with({ 'path' => '/etc/cassandra/cassandra-rackdc.properties', @@ -237,45 +327,75 @@ let :params do { - :authenticator => 'foo', - :authorizer => 'foo', - :auto_bootstrap => false, - :auto_snapshot => 'foo', - :batch_size_warn_threshold_in_kb => '42', - :client_encryption_enabled => 'foo', - :client_encryption_keystore => 'foo', - :client_encryption_keystore_password => 'foo', - :cluster_name => 'foo', - :commitlog_directory => 'foo', - :concurrent_counter_writes => 'foo', - :concurrent_reads => 'foo', - :concurrent_writes => 'foo', - :config_path => '/etc', - :data_file_directories => ['foo', 'bar'], - :disk_failure_policy => 'foo', - :endpoint_snitch => 'foo', - :hinted_handoff_enabled => 'foo', - :incremental_backups => 'foo', - :internode_compression => 'foo', - :listen_address => 'foo', - :native_transport_port => 'foo', - :num_tokens => 'foo', - :partitioner => 'foo', - :rpc_address => 'foo', - :rpc_port => 'foo', - :rpc_server_type => 'foo', - :saved_caches_directory => 'foo', - :seeds => 'foo', - :server_encryption_internode => 'foo', - :server_encryption_keystore => 'foo', - :server_encryption_keystore_password => 'foo', - :server_encryption_truststore => 'foo', - :server_encryption_truststore_password => 'foo', - :snapshot_before_compaction => 'foo', - :ssl_storage_port => 'foo', - :start_native_transport => 'foo', - :start_rpc => 'foo', - :storage_port => 'foo', + :authenticator => 'foo', + :authorizer => 'foo', + :auto_bootstrap => false, + :auto_snapshot => 'foo', + :batch_size_warn_threshold_in_kb => '42', + :client_encryption_enabled => 'foo', + :client_encryption_keystore => 'foo', + :client_encryption_keystore_password => 'foo', + :cluster_name => 'foo', + :commitlog_directory => 'foo', + :concurrent_counter_writes => 'foo', + :concurrent_reads => 'foo', + :concurrent_writes => 'foo', + :config_path => '/etc', + :data_file_directories => ['foo', 'bar'], + :disk_failure_policy => 'foo', + :endpoint_snitch => 'foo', + :hinted_handoff_enabled => 'foo', + :incremental_backups => 'foo', + :internode_compression => 'foo', + :listen_address => 'foo', + :native_transport_port => 'foo', + :num_tokens => 'foo', + :partitioner => 'foo', + :rpc_address => 'foo', + :rpc_port => 'foo', + :rpc_server_type => 'foo', + :saved_caches_directory => 'foo', + :seeds => 'foo', + :server_encryption_internode => 'foo', + :server_encryption_keystore => 'foo', + :server_encryption_keystore_password => 'foo', + :server_encryption_truststore => 'foo', + :server_encryption_truststore_password => 'foo', + :snapshot_before_compaction => 'foo', + :ssl_storage_port => 'foo', + :start_native_transport => 'foo', + :start_rpc => 'foo', + :storage_port => 'foo', + :batchlog_replay_throttle_in_kb => 'batchlog_replay_throttle_in_kb', + :cas_contention_timeout_in_ms => 'cas_contention_timeout_in_ms', + :column_index_size_in_kb => 'column_index_size_in_kb', + :commit_failure_policy => 'commit_failure_policy', + :compaction_throughput_mb_per_sec => 'compaction_throughput_mb_per_sec', + :counter_cache_save_period => 'counter_cache_save_period', + :counter_write_request_timeout_in_ms => 'counter_write_request_timeout_in_ms', + :cross_node_timeout => 'cross_node_timeout', + :dynamic_snitch_badness_threshold => 'dynamic_snitch_badness_threshold', + :dynamic_snitch_reset_interval_in_ms => 'dynamic_snitch_reset_interval_in_ms', + :dynamic_snitch_update_interval_in_ms => 'dynamic_snitch_update_interval_in_ms', + :hinted_handoff_throttle_in_kb => 'hinted_handoff_throttle_in_kb', + :index_summary_resize_interval_in_minutes => 'index_summary_resize_interval_in_minutes', + :inter_dc_tcp_nodelay => 'inter_dc_tcp_nodelay', + :max_hints_delivery_threads => 'max_hints_delivery_threads', + :max_hint_window_in_ms => 'max_hint_window_in_ms', + :permissions_validity_in_ms => 'permissions_validity_in_ms', + :range_request_timeout_in_ms => 'range_request_timeout_in_ms', + :read_request_timeout_in_ms => 'read_request_timeout_in_ms', + :request_scheduler => 'request_scheduler', + :request_timeout_in_ms => 'request_timeout_in_ms', + :row_cache_save_period => 'row_cache_save_period', + :row_cache_size_in_mb => 'row_cache_size_in_mb', + :sstable_preemptive_open_interval_in_mb => 'sstable_preemptive_open_interval_in_mb', + :tombstone_failure_threshold => 'tombstone_failure_threshold', + :tombstone_warn_threshold => 'tombstone_warn_threshold', + :trickle_fsync => 'trickle_fsync', + :trickle_fsync_interval_in_kb => 'trickle_fsync_interval_in_kb', + :truncate_request_timeout_in_ms => 'truncate_request_timeout_in_ms', + :write_request_timeout_in_ms => 'write_request_timeout_in_ms', } end @@ -319,6 +439,36 @@ it { should contain_file('/etc/cassandra.yaml').with_content(/start_native_transport: foo/) } it { should contain_file('/etc/cassandra.yaml').with_content(/start_rpc: foo/) } it { should contain_file('/etc/cassandra.yaml').with_content(/storage_port: foo/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/batchlog_replay_throttle_in_kb: batchlog_replay_throttle_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/cas_contention_timeout_in_ms: cas_contention_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/column_index_size_in_kb: column_index_size_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/commit_failure_policy: commit_failure_policy/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/compaction_throughput_mb_per_sec: compaction_throughput_mb_per_sec/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/counter_cache_save_period: counter_cache_save_period/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/counter_write_request_timeout_in_ms: counter_write_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/cross_node_timeout: cross_node_timeout/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_badness_threshold: dynamic_snitch_badness_threshold/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_reset_interval_in_ms: dynamic_snitch_reset_interval_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_update_interval_in_ms: dynamic_snitch_update_interval_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/hinted_handoff_throttle_in_kb: hinted_handoff_throttle_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/index_summary_resize_interval_in_minutes: index_summary_resize_interval_in_minutes/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/inter_dc_tcp_nodelay: inter_dc_tcp_nodelay/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/max_hints_delivery_threads: max_hints_delivery_threads/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/max_hint_window_in_ms: max_hint_window_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/permissions_validity_in_ms: permissions_validity_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/range_request_timeout_in_ms: range_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/read_request_timeout_in_ms: read_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/request_scheduler: request_scheduler/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/request_timeout_in_ms: request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/row_cache_save_period: row_cache_save_period/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/row_cache_size_in_mb: row_cache_size_in_mb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/sstable_preemptive_open_interval_in_mb: sstable_preemptive_open_interval_in_mb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/tombstone_failure_threshold: tombstone_failure_threshold/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/tombstone_warn_threshold: tombstone_warn_threshold/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/trickle_fsync: trickle_fsync/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/trickle_fsync_interval_in_kb: trickle_fsync_interval_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/truncate_request_timeout_in_ms: truncate_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/write_request_timeout_in_ms: write_request_timeout_in_ms/) } end context 'Test the cassandra1.yml temlate.' do @@ -330,42 +480,72 @@ let :params do { - :authenticator => 'foo', - :authorizer => 'foo', - :auto_bootstrap => false, - :auto_snapshot => 'foo', - :cassandra_yaml_tmpl => 'cassandra/cassandra1.yaml.erb', - :client_encryption_enabled => 'foo', - :client_encryption_keystore => 'foo', - :client_encryption_keystore_password => 'foo', - :cluster_name => 'foo', - :commitlog_directory => 'foo', - :config_path => '/etc', - :data_file_directories => ['foo', 'bar'], - :disk_failure_policy => 'foo', - :endpoint_snitch => 'foo', - :hinted_handoff_enabled => 'foo', - :incremental_backups => 'foo', - :internode_compression => 'foo', - :listen_address => 'foo', - :native_transport_port => 'foo', - :num_tokens => 'foo', - :partitioner => 'foo', - :rpc_address => 'foo', - :rpc_port => 'foo', - :rpc_server_type => 'foo', - :saved_caches_directory => 'foo', - :seeds => 'foo', - :server_encryption_internode => 'foo', - :server_encryption_keystore => 'foo', - :server_encryption_keystore_password => 'foo', - :server_encryption_truststore => 'foo', - :server_encryption_truststore_password => 'foo', - :snapshot_before_compaction => 'foo', - :ssl_storage_port => 'foo', - :start_native_transport => 'foo', - :start_rpc => 'foo', - :storage_port => 'foo', + :authenticator => 'foo', + :authorizer => 'foo', + :auto_bootstrap => false, + :auto_snapshot => 'foo', + :cassandra_yaml_tmpl => 'cassandra/cassandra1.yaml.erb', + :client_encryption_enabled => 'foo', + :client_encryption_keystore => 'foo', + :client_encryption_keystore_password => 'foo', + :cluster_name => 'foo', + :commitlog_directory => 'foo', + :config_path => '/etc', + :data_file_directories => ['foo', 'bar'], + :disk_failure_policy => 'foo', + :endpoint_snitch => 'foo', + :hinted_handoff_enabled => 'foo', + :incremental_backups => 'foo', + :internode_compression => 'foo', + :listen_address => 'foo', + :native_transport_port => 'foo', + :num_tokens => 'foo', + :partitioner => 'foo', + :rpc_address => 'foo', + :rpc_port => 'foo', + :rpc_server_type => 'foo', + :saved_caches_directory => 'foo', + :seeds => 'foo', + :server_encryption_internode => 'foo', + :server_encryption_keystore => 'foo', + :server_encryption_keystore_password => 'foo', + :server_encryption_truststore => 'foo', + :server_encryption_truststore_password => 'foo', + :snapshot_before_compaction => 'foo', + :ssl_storage_port => 'foo', + :start_native_transport => 'foo', + :start_rpc => 'foo', + :storage_port => 'foo', + :batchlog_replay_throttle_in_kb => 'batchlog_replay_throttle_in_kb', + :cas_contention_timeout_in_ms => 'cas_contention_timeout_in_ms', + :column_index_size_in_kb => 'column_index_size_in_kb', + :commit_failure_policy => 'commit_failure_policy', + :compaction_throughput_mb_per_sec => 'compaction_throughput_mb_per_sec', + :counter_cache_save_period => 'counter_cache_save_period', + :counter_write_request_timeout_in_ms => 'counter_write_request_timeout_in_ms', + :cross_node_timeout => 'cross_node_timeout', + :dynamic_snitch_badness_threshold => 'dynamic_snitch_badness_threshold', + :dynamic_snitch_reset_interval_in_ms => 'dynamic_snitch_reset_interval_in_ms', + :dynamic_snitch_update_interval_in_ms => 'dynamic_snitch_update_interval_in_ms', + :hinted_handoff_throttle_in_kb => 'hinted_handoff_throttle_in_kb', + :index_summary_resize_interval_in_minutes => 'index_summary_resize_interval_in_minutes', + :inter_dc_tcp_nodelay => 'inter_dc_tcp_nodelay', + :max_hints_delivery_threads => 'max_hints_delivery_threads', + :max_hint_window_in_ms => 'max_hint_window_in_ms', + :permissions_validity_in_ms => 'permissions_validity_in_ms', + :range_request_timeout_in_ms => 'range_request_timeout_in_ms', + :read_request_timeout_in_ms => 'read_request_timeout_in_ms', + :request_scheduler => 'request_scheduler', + :request_timeout_in_ms => 'request_timeout_in_ms', + :row_cache_save_period => 'row_cache_save_period', + :row_cache_size_in_mb => 'row_cache_size_in_mb', + :sstable_preemptive_open_interval_in_mb => 'sstable_preemptive_open_interval_in_mb', + :tombstone_failure_threshold => 'tombstone_failure_threshold', + :tombstone_warn_threshold => 'tombstone_warn_threshold', + :trickle_fsync => 'trickle_fsync', + :trickle_fsync_interval_in_kb => 'trickle_fsync_interval_in_kb', + :truncate_request_timeout_in_ms => 'truncate_request_timeout_in_ms', + :write_request_timeout_in_ms => 'write_request_timeout_in_ms', } end @@ -405,6 +585,27 @@ it { should contain_file('/etc/cassandra.yaml').with_content(/start_native_transport: foo/) } it { should contain_file('/etc/cassandra.yaml').with_content(/start_rpc: foo/) } it { should contain_file('/etc/cassandra.yaml').with_content(/storage_port: foo/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/column_index_size_in_kb: column_index_size_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/compaction_throughput_mb_per_sec: compaction_throughput_mb_per_sec/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/cross_node_timeout: cross_node_timeout/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_badness_threshold: dynamic_snitch_badness_threshold/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_reset_interval_in_ms: dynamic_snitch_reset_interval_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/dynamic_snitch_update_interval_in_ms: dynamic_snitch_update_interval_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/hinted_handoff_throttle_in_kb: hinted_handoff_throttle_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/inter_dc_tcp_nodelay: inter_dc_tcp_nodelay/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/max_hints_delivery_threads: max_hints_delivery_threads/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/max_hint_window_in_ms: max_hint_window_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/permissions_validity_in_ms: permissions_validity_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/range_request_timeout_in_ms: range_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/read_request_timeout_in_ms: read_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/request_scheduler: request_scheduler/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/request_timeout_in_ms: request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/row_cache_save_period: row_cache_save_period/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/row_cache_size_in_mb: row_cache_size_in_mb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/trickle_fsync: trickle_fsync/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/trickle_fsync_interval_in_kb: trickle_fsync_interval_in_kb/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/truncate_request_timeout_in_ms: truncate_request_timeout_in_ms/) } + it { should contain_file('/etc/cassandra.yaml').with_content(/write_request_timeout_in_ms: write_request_timeout_in_ms/) } end context 'Test the dc and rack properties.' do