ruby_rabbitmq_janus 2.5.0.pre.210 → 2.5.0.pre.213
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/requests/admin/{handles.json → list_handles.json} +0 -0
- data/config/requests/admin/{sessions.json → list_sessions.json} +0 -0
- data/config/requests/admin/{tokens.json → list_tokens.json} +0 -0
- data/config/requests/admin/set_libnice_debug.json +6 -0
- data/config/requests/admin/set_locking_debug.json +2 -2
- data/config/requests/admin/set_log_colors.json +6 -0
- data/config/requests/admin/set_log_level.json +2 -2
- data/config/requests/admin/set_log_timestamps.json +6 -0
- data/config/requests/admin/set_max_nack_queue.json +6 -0
- data/config/requests/admin/set_no_media_timer.json +6 -0
- data/config/requests/admin/set_session_timeout.json +7 -0
- data/config/requests/admin/start_pcap.json +5 -3
- data/config/requests/admin/stop_pcap.json +2 -0
- data/config/requests/admin/stop_text2pcap.json +1 -1
- data/lib/generators/ruby_rabbitmq_janus/initializer_generator.rb +1 -1
- data/lib/generators/ruby_rabbitmq_janus/install_generator.rb +1 -1
- data/lib/generators/ruby_rabbitmq_janus/migration_generator.rb +1 -1
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/janus/processus/event.rb +1 -1
- data/lib/rrj/janus/processus/event_admin.rb +5 -1
- data/lib/rrj/janus/processus/keepalive/keepalive_thread.rb +0 -4
- data/lib/rrj/janus/transactions/admin.rb +2 -0
- data/lib/rrj/rabbit/propertie.rb +6 -2
- data/lib/rrj/rabbit/publish/listener_admin.rb +3 -0
- data/lib/rrj/rabbit/publish/publisher_admin.rb +8 -7
- data/lib/rrj/tools/gem/config.rb +2 -0
- data/lib/rrj/tools/replaces/admin.rb +21 -35
- data/spec/request/admin/request_add_token_spec.rb +29 -0
- data/spec/request/admin/request_allow_token_spec.rb +20 -0
- data/spec/request/admin/request_disallow_token_spec.rb +20 -0
- data/spec/request/admin/request_handle_info_spec.rb +13 -14
- data/spec/request/admin/request_list_handles_spec.rb +19 -0
- data/spec/request/admin/request_list_sessions_spec.rb +20 -0
- data/spec/request/admin/request_list_tokens_spec.rb +18 -0
- data/spec/request/admin/request_remove_token_spec.rb +18 -0
- data/spec/request/admin/request_set_libnice_debug_spec.rb +28 -0
- data/spec/request/admin/request_set_locking_debug_spec.rb +20 -10
- data/spec/request/admin/request_set_log_colors_spec.rb +28 -0
- data/spec/request/admin/request_set_log_level_spec.rb +64 -12
- data/spec/request/admin/request_set_log_timestamps_spec.rb +28 -0
- data/spec/request/admin/request_set_max_nack_queue_spec.rb +28 -0
- data/spec/request/admin/request_set_no_media_timer_spec.rb +28 -0
- data/spec/request/admin/request_set_session_timeout_spec.rb +35 -0
- data/spec/request/admin/request_start_pcap_spec.rb +27 -0
- data/spec/request/admin/request_start_text2pcap_spec.rb +26 -0
- data/spec/request/admin/request_stop_pcap_spec.rb +20 -0
- data/spec/request/admin/request_stop_text2pcap_spec.rb +27 -0
- data/spec/spec_helper.rb +7 -1
- data/spec/support/admin_requester.rb +48 -0
- data/spec/support/schemas/request/admin/{handles.json → list_handles.json} +0 -0
- data/spec/support/schemas/request/admin/{sessions.json → list_sessions.json} +0 -0
- data/spec/support/schemas/request/base/error.json +22 -0
- data/spec/support/schemas/request/base/success.json +11 -0
- metadata +52 -15
- data/spec/request/admin/request_handles_spec.rb +0 -21
- data/spec/request/admin/request_sessions_spec.rb +0 -17
- data/spec/request/admin/request_tokens_spec.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 020d8174744036d661c515c3238626b5ae010e8cb5f720569bd5b9ed7eb1f0b2
|
4
|
+
data.tar.gz: e107eebc1d2c28ab8be3cb82b8fe5eeed8f887f6132bce3ad5b044515bd1e08d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9da41b78b1d7bd8548885b1a9ed85822131450fe1f6b71e79fab75e3d1293c3e6b3a9e1202c90bf785a13f80bf7a086b9a2a5541de88a22fdede4e0b42ee3943
|
7
|
+
data.tar.gz: 121b9c5316bae6c8045a199fc853a276cab060fb378d033d4ff8f44f4294f3322d593d2430302a0e03aea0c816171e756b6a47e8934312a6f855cd99d664378e
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,8 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"janus": "start_pcap",
|
3
|
+
"transaction": "<transaction>",
|
4
|
+
"session_id": "<number>",
|
5
|
+
"handle_id": "<number>",
|
6
|
+
"admin_secret": "<string>",
|
3
7
|
"folder" : "<string>",
|
4
8
|
"filename" : "<string>",
|
5
|
-
"truncate" : "<number>"
|
6
|
-
"transaction": "<transaction>",
|
7
|
-
"admin_secret": "<string>"
|
9
|
+
"truncate" : "<number>"
|
8
10
|
}
|
@@ -6,7 +6,7 @@ module RubyRabbitmqJanus
|
|
6
6
|
class InitializerGenerator < Rails::Generators::Base
|
7
7
|
desc 'Generate a initializer to this gem for rails application.'
|
8
8
|
|
9
|
-
source_root File.expand_path('
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
10
|
|
11
11
|
# Create an initializer
|
12
12
|
def copy_initializer
|
@@ -11,7 +11,7 @@ module RubyRabbitmqJanus
|
|
11
11
|
config.autoload_paths += Dir[Rails.root.join('app', 'ruby_rabbitmq_janus')]
|
12
12
|
AUTOLOAD
|
13
13
|
|
14
|
-
source_root File.expand_path('
|
14
|
+
source_root File.expand_path('templates', __dir__)
|
15
15
|
|
16
16
|
# Generate files with default code
|
17
17
|
def add_actions
|
@@ -14,7 +14,7 @@ module RubyRabbitmqJanus
|
|
14
14
|
|
15
15
|
desc 'Add to rails project RubyRabbitmqJanus migration file.'
|
16
16
|
|
17
|
-
source_root File.expand_path('
|
17
|
+
source_root File.expand_path('templates', __dir__)
|
18
18
|
|
19
19
|
def install
|
20
20
|
migration_template 'migration.rb',
|
data/lib/rrj/info.rb
CHANGED
@@ -30,7 +30,7 @@ module RubyRabbitmqJanus
|
|
30
30
|
RabbitMQ server in a queue for janus server. Janus processes a message and
|
31
31
|
send to RabbitMQ server in a queue for gem. Once the received message is
|
32
32
|
decoded and returned through the Rails API.
|
33
|
-
|
33
|
+
DESC
|
34
34
|
|
35
35
|
# Define homepage
|
36
36
|
HOMEPAGE = 'https://github.com/dazzl-tv/ruby-rabbitmq-janus'
|
@@ -1,12 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# :reek:InstanceVariableAssumption
|
4
|
+
|
3
5
|
module RubyRabbitmqJanus
|
4
6
|
module Janus
|
5
7
|
module Concurrencies
|
8
|
+
# Manage admin message in queue public
|
9
|
+
# Work In Progress
|
6
10
|
class EventAdmin < Event
|
7
11
|
include Singleton
|
8
12
|
|
9
|
-
NAME_VAR = :publish_adm
|
13
|
+
NAME_VAR = :publish_adm
|
10
14
|
|
11
15
|
private
|
12
16
|
|
@@ -55,7 +55,6 @@ module RubyRabbitmqJanus
|
|
55
55
|
|
56
56
|
# Start a timer for TTL
|
57
57
|
# rubocop:disable Metrics/AbcSize
|
58
|
-
# rubocop:disable Metrics/MethodLength
|
59
58
|
# :reek:TooManyStatements
|
60
59
|
def start
|
61
60
|
@timer.loop_keepalive do
|
@@ -77,7 +76,6 @@ module RubyRabbitmqJanus
|
|
77
76
|
raise Errors::Janus::KeepaliveThread::Start
|
78
77
|
end
|
79
78
|
# rubocop:enable Metrics/AbcSize
|
80
|
-
# rubocop:enable Metrics/MethodLength
|
81
79
|
|
82
80
|
# Kill session and disable instance
|
83
81
|
def kill
|
@@ -87,7 +85,6 @@ module RubyRabbitmqJanus
|
|
87
85
|
raise Errors::Janus::KeepaliveThread::Kill
|
88
86
|
end
|
89
87
|
|
90
|
-
# rubocop:disable Metrics/MethodLength
|
91
88
|
# :reek:TooManyStatements
|
92
89
|
def instance_is_down
|
93
90
|
janus = find_model
|
@@ -105,7 +102,6 @@ module RubyRabbitmqJanus
|
|
105
102
|
rescue
|
106
103
|
raise Errors::Janus::KeepaliveThread::InstanceIsDown
|
107
104
|
end
|
108
|
-
# rubocop:enable Metrics/MethodLength
|
109
105
|
|
110
106
|
private
|
111
107
|
|
data/lib/rrj/rabbit/propertie.rb
CHANGED
@@ -28,8 +28,8 @@ module RubyRabbitmqJanus
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# Define option sending to rabbitmq for janus admin message
|
31
|
-
def options_admin(
|
32
|
-
base.merge(routing_key:
|
31
|
+
def options_admin(_type_request)
|
32
|
+
base.merge(routing_key: routing_key_admin)
|
33
33
|
rescue
|
34
34
|
raise Errors::Rabbit::Propertie::Options_admin
|
35
35
|
end
|
@@ -49,6 +49,10 @@ module RubyRabbitmqJanus
|
|
49
49
|
def base
|
50
50
|
{ correlation_id: @correlation, content_type: 'application/json' }
|
51
51
|
end
|
52
|
+
|
53
|
+
def routing_key_admin
|
54
|
+
Tools::Cluster.instance.queue_admin_to(@instance)
|
55
|
+
end
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# :reek:InstanceVariableAssumption
|
4
|
+
|
3
5
|
module RubyRabbitmqJanus
|
4
6
|
module Rabbit
|
5
7
|
module Publisher
|
@@ -10,7 +12,8 @@ module RubyRabbitmqJanus
|
|
10
12
|
#
|
11
13
|
# @param [String] exchange Exchange used for the transaction
|
12
14
|
def initialize(exchange)
|
13
|
-
@reply = exchange.queue(
|
15
|
+
@reply = exchange.queue('', exclusive: true)
|
16
|
+
# @reply = exchange.queue(Tools::Config.instance.queue_admin_from)
|
14
17
|
super(exchange)
|
15
18
|
subscribe_to_queue
|
16
19
|
rescue
|
@@ -21,15 +24,13 @@ module RubyRabbitmqJanus
|
|
21
24
|
#
|
22
25
|
# @param [String] request JSON request sending to rabbitmq queue
|
23
26
|
#
|
24
|
-
# @return [Janus::Response::
|
27
|
+
# @return [Janus::Response::Admin] response for an request reading
|
25
28
|
# by janus instance
|
26
29
|
def publish(request)
|
27
|
-
# super(request)
|
28
30
|
@message = request
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# return_response
|
31
|
+
@exchange.publish(@message.to_json,
|
32
|
+
request.options.merge!(reply_to: reply.name))
|
33
|
+
return_response
|
33
34
|
rescue
|
34
35
|
raise Errors::Rabbit::PublisherAdmin::Pusblish
|
35
36
|
end
|
data/lib/rrj/tools/gem/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# rubocop:disable Naming/MemoizedInstanceVariableName
|
3
4
|
module RubyRabbitmqJanus
|
4
5
|
module Tools
|
5
6
|
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
@@ -134,3 +135,4 @@ module RubyRabbitmqJanus
|
|
134
135
|
end
|
135
136
|
end
|
136
137
|
end
|
138
|
+
# rubocop:enable Naming/MemoizedInstanceVariableName
|
@@ -10,6 +10,18 @@ module RubyRabbitmqJanus
|
|
10
10
|
class Admin < Handle
|
11
11
|
private
|
12
12
|
|
13
|
+
KEY_ACCEPTED = %w[colors
|
14
|
+
debug
|
15
|
+
level
|
16
|
+
filename
|
17
|
+
folder
|
18
|
+
max_nack_queue
|
19
|
+
no_media_timer
|
20
|
+
timestamps
|
21
|
+
token
|
22
|
+
truncate
|
23
|
+
session_timeout].freeze
|
24
|
+
|
13
25
|
def replace_element_classic
|
14
26
|
super
|
15
27
|
replace_admins if request.key?('admin_secret')
|
@@ -23,47 +35,21 @@ module RubyRabbitmqJanus
|
|
23
35
|
|
24
36
|
def replace_admins
|
25
37
|
replace_admin
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
replace_filename if request.key?('filename')
|
30
|
-
replace_truncate if request.key?('truncate')
|
31
|
-
end
|
32
|
-
|
33
|
-
def replace_admin
|
34
|
-
request['admin_secret'] = admin_pass
|
35
|
-
rescue => message
|
36
|
-
Tools::Log.instance.warn "Error replace admin_secret : #{message}"
|
37
|
-
end
|
38
|
-
|
39
|
-
def replace_level
|
40
|
-
request['level'] = type.convert('level', opts)
|
41
|
-
rescue => message
|
42
|
-
Tools::Log.instance.warn "Error replace level : #{message}"
|
38
|
+
KEY_ACCEPTED.each do |key|
|
39
|
+
replace_component(key) if request.key?(key)
|
40
|
+
end
|
43
41
|
end
|
44
42
|
|
45
|
-
def
|
46
|
-
request[
|
43
|
+
def replace_component(key)
|
44
|
+
request[key] = type.convert(key, opts)
|
47
45
|
rescue => message
|
48
|
-
Tools::Log.instance.warn "Error replace
|
46
|
+
Tools::Log.instance.warn "Error replace #{key} : #{message}"
|
49
47
|
end
|
50
48
|
|
51
|
-
def
|
52
|
-
request['
|
53
|
-
rescue => message
|
54
|
-
Tools::Log.instance.warn "Error replace folder : #{message}"
|
55
|
-
end
|
56
|
-
|
57
|
-
def replace_filename
|
58
|
-
request['filename'] = type.convert('filename', opts)
|
59
|
-
rescue => message
|
60
|
-
Tools::Log.instance.warn "Error replace filename : #{message}"
|
61
|
-
end
|
62
|
-
|
63
|
-
def replace_truncate
|
64
|
-
request['truncate'] = type.convert('truncate', opts)
|
49
|
+
def replace_admin
|
50
|
+
request['admin_secret'] = admin_pass
|
65
51
|
rescue => message
|
66
|
-
Tools::Log.instance.warn "Error replace
|
52
|
+
Tools::Log.instance.warn "Error replace admin_secret : #{message}"
|
67
53
|
end
|
68
54
|
|
69
55
|
def admin_pass
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Option token has disabled do response is automatically an error
|
6
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- add_token', type: :request,
|
7
|
+
level: :admin,
|
8
|
+
name: :add_token do
|
9
|
+
before do
|
10
|
+
help_admin_prepare
|
11
|
+
help_admin_request_tested(parameter)
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:type) { 'admin::add_token' }
|
15
|
+
|
16
|
+
context 'when no configured in Janus' do
|
17
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
18
|
+
let(:parameter) { {} }
|
19
|
+
|
20
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when configured in janus' do
|
24
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('2').id.to_s } }
|
25
|
+
let(:parameter) { { 'token' => [*('a'..'z'), *('0'..'9')].sample(24).join } }
|
26
|
+
|
27
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Option token has disabled do response is automatically an error
|
6
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- allow_token', type: :request,
|
7
|
+
level: :admin,
|
8
|
+
name: :allow_token do
|
9
|
+
before do
|
10
|
+
help_admin_prepare
|
11
|
+
help_admin_create_session
|
12
|
+
help_admin_create_handler
|
13
|
+
help_admin_request_tested
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
17
|
+
let(:type) { 'admin::allow_token' }
|
18
|
+
|
19
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Option token has disabled do response is automatically an error
|
6
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- disallow_token', type: :request,
|
7
|
+
level: :admin,
|
8
|
+
name: :disallow_token do
|
9
|
+
before do
|
10
|
+
help_admin_prepare
|
11
|
+
help_admin_create_session
|
12
|
+
help_admin_create_handler
|
13
|
+
help_admin_request_tested
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
17
|
+
let(:type) { 'admin::disallow_token' }
|
18
|
+
|
19
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
20
|
+
end
|
@@ -1,21 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# LCO: tagged broken 2018/01/26 for v2.3.0
|
4
|
-
# see: https://travis-ci.org/dazzl-tv/ruby-rabbitmq-janus/builds/333359315
|
5
|
-
|
6
3
|
require 'spec_helper'
|
7
4
|
|
8
|
-
describe 'RubyRabbitmqJanus::
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- handle_info', type: :request,
|
6
|
+
level: :admin,
|
7
|
+
name: :handle_info do
|
8
|
+
before do
|
9
|
+
help_admin_prepare
|
10
|
+
help_admin_create_session
|
11
|
+
help_admin_create_handler
|
12
|
+
help_admin_request_tested
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
15
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
16
|
+
let(:type) { 'admin::handle_info' }
|
17
|
+
|
18
|
+
it { expect(@transaction.to_json).to match_json_schema(type) }
|
19
|
+
it { expect(@transaction.info).to be_a(Hash) }
|
21
20
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- list_handles', type: :request,
|
6
|
+
level: :admin,
|
7
|
+
name: :list_handles do
|
8
|
+
before do
|
9
|
+
help_admin_prepare
|
10
|
+
help_admin_create_session
|
11
|
+
help_admin_request_tested
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
15
|
+
let(:type) { 'admin::list_handles' }
|
16
|
+
|
17
|
+
it { expect(@transaction.to_json).to match_json_schema(type) }
|
18
|
+
it { expect(@transaction.handles).to be_a(Array) }
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- list_sessions', type: :request,
|
6
|
+
level: :admin,
|
7
|
+
name: :list_sessions do
|
8
|
+
before do
|
9
|
+
help_admin_prepare
|
10
|
+
help_admin_create_session
|
11
|
+
help_admin_create_handler
|
12
|
+
help_admin_request_tested
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
16
|
+
let(:type) { 'admin::list_sessions' }
|
17
|
+
|
18
|
+
it { expect(@transaction.to_json).to match_json_schema(type) }
|
19
|
+
it { expect(@transaction.sessions).to be_a(Array) }
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Dont configured in Janus Instance so return automatically an error
|
6
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- list_tokens', type: :request,
|
7
|
+
level: :admin,
|
8
|
+
name: :list_tokens do
|
9
|
+
before do
|
10
|
+
help_admin_prepare
|
11
|
+
help_admin_request_tested
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
15
|
+
let(:type) { 'admin::list_tokens' }
|
16
|
+
|
17
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
# Dont configured in Janus Instance so return automatically an error
|
6
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- remove_tokens', type: :request,
|
7
|
+
level: :admin,
|
8
|
+
name: :remove_token do
|
9
|
+
before do
|
10
|
+
help_admin_prepare
|
11
|
+
help_admin_request_tested
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
15
|
+
let(:type) { 'admin::remove_token' }
|
16
|
+
|
17
|
+
it { expect(@transaction.to_json).to match_json_schema('base::error') }
|
18
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- set_libnice_debug', type: :request,
|
6
|
+
level: :admin,
|
7
|
+
name: :set_libnice_debug do
|
8
|
+
before do
|
9
|
+
help_admin_prepare
|
10
|
+
help_admin_request_tested(parameters)
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
14
|
+
let(:type) { 'admin::set_libnice_debug' }
|
15
|
+
let(:parameters) { { 'debug' => debug } }
|
16
|
+
|
17
|
+
context 'when debug is true' do
|
18
|
+
let(:debug) { true }
|
19
|
+
|
20
|
+
it { expect(@transaction.to_json).to match_json_schema('base::success') }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when debug is false' do
|
24
|
+
let(:debug) { false }
|
25
|
+
|
26
|
+
it { expect(@transaction.to_json).to match_json_schema('base::success') }
|
27
|
+
end
|
28
|
+
end
|
@@ -2,17 +2,27 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe 'RubyRabbitmqJanus::
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
describe 'RubyRabbitmqJanus::RRJAdmin -- set_locking_debug', type: :request,
|
6
|
+
level: :admin,
|
7
|
+
name: :set_locking_debug do
|
8
|
+
before do
|
9
|
+
help_admin_prepare
|
10
|
+
help_admin_request_tested(parameters)
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
|
14
|
+
let(:type) { 'admin::set_locking_debug' }
|
15
|
+
let(:parameters) { { 'debug' => debug } }
|
16
|
+
|
17
|
+
context 'when debug is true' do
|
18
|
+
let(:debug) { true }
|
19
|
+
|
20
|
+
it { expect(@transaction.to_json).to match_json_schema(type) }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when debug is false' do
|
24
|
+
let(:debug) { false }
|
25
|
+
|
26
|
+
it { expect(@transaction.to_json).to match_json_schema(type) }
|
17
27
|
end
|
18
28
|
end
|