Skip to content

Commit

Permalink
Fix: failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Mohite <b518004@iiit-bh.ac.in>
  • Loading branch information
mohite-abhi committed Jan 16, 2023
1 parent 2b75f2d commit 9f3a41d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pkg/scalers/rabbitmq_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,22 @@ var testRabbitMQMetadata = []parseRabbitMQMetadataTestData{
{map[string]string{"mode": "QueueLength", "value": "1000", "queueName": "sample", "host": "http://", "useRegex": "true", "excludeUnacknowledged": "true"}, false, map[string]string{}},
// amqp and excludeUnacknowledged
{map[string]string{"mode": "QueueLength", "value": "1000", "queueName": "sample", "host": "amqp://", "useRegex": "true", "excludeUnacknowledged": "true"}, true, map[string]string{}},
// success, TLS only
}

var testRabbitMQAuthParamData = []parseRabbitMQAuthParamTestData{
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "cert": "ceert", "key": "keey"}, false, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "cert": "ceert", "key": "keey"}, false, true},
// success, TLS cert/key and assumed public CA
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "cert": "ceert", "key": "keey"}, false, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "cert": "ceert", "key": "keey"}, false, true},
// success, TLS cert/key + key password and assumed public CA
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "cert": "ceert", "key": "keey", "keyPassword": "keeyPassword"}, false, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "cert": "ceert", "key": "keey", "keyPassword": "keeyPassword"}, false, true},
// success, TLS CA only
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa"}, false, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa"}, false, true},
// failure, TLS missing cert
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "key": "kee"}, true, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "key": "kee"}, true, true},
// failure, TLS missing key
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "cert": "ceert"}, true, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "enable", "ca": "caaa", "cert": "ceert"}, true, true},
// failure, TLS invalid
{map[string]string{"mode": "MessageRate", "value": "12", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "yes", "ca": "caaa", "cert": "ceert", "key": "kee"}, true, true},
{map[string]string{"mode": "QueueLength", "value": "20", "queueName": "sample", "host": "amqps://"}, map[string]string{"tls": "yes", "ca": "caaa", "cert": "ceert", "key": "kee"}, true, true},
}
var rabbitMQMetricIdentifiers = []rabbitMQMetricIdentifier{
{&testRabbitMQMetadata[1], 0, "s0-rabbitmq-sample"},
Expand Down

0 comments on commit 9f3a41d

Please sign in to comment.