test/plugin/test_in_cloudwatch.rb in fluent-plugin-cloudwatch-1.2.14 vs test/plugin/test_in_cloudwatch.rb in fluent-plugin-cloudwatch-1.2.15
- old
+ new
@@ -114,6 +114,32 @@
assert_equal 'rds01', d.instance.dimensions_value
assert_equal [{ :name => 'DBInstanceIdentifier', :value => 'rds01' }], d.instance.dimensions
assert_equal true, d.instance.delayed_start
end
+ ### for CloudWatchLogsMetricFilters
+ CONFIG_CWLOG_MF = %[
+ tag cloudwatch
+ aws_key_id test_key_id
+ aws_sec_key test_sec_key
+ cw_endpoint test_cloud_watch_endpoint
+ namespace LogMetrics
+ metric_name LogAccessCount,LogErrorCount
+ ]
+
+ def create_driver_cwlog_mf(conf = CONFIG_CWLOG_MF)
+ Fluent::Test::InputTestDriver.new(Fluent::CloudwatchInput).configure(conf)
+ end
+
+ def test_configure_cwlog_mf
+ d = create_driver_cwlog_mf
+ assert_equal 'cloudwatch', d.instance.tag
+ assert_equal 'test_key_id', d.instance.aws_key_id
+ assert_equal 'test_sec_key', d.instance.aws_sec_key
+ assert_equal 'test_cloud_watch_endpoint', d.instance.cw_endpoint
+ assert_equal 'LogMetrics', d.instance.namespace
+ assert_equal 'LogAccessCount,LogErrorCount', d.instance.metric_name
+ assert_nil d.instance.dimensions_name
+ assert_nil d.instance.dimensions_value
+ assert_equal [], d.instance.dimensions
+ end
end