evostream-event 1.0.3.pre.91 → 2.0.0.pre.816370746
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/evostream/cli/option/argument.rb +2 -0
- data/lib/evostream/cli/option/search.rb +2 -0
- data/lib/evostream/cli/runner.rb +5 -3
- data/lib/evostream/event/commands.rb +1 -1
- data/lib/evostream/event/commands/destroy.rb +1 -1
- data/lib/evostream/event/commands/get_stream_info.rb +1 -1
- data/lib/evostream/event/commands/list_streams.rb +1 -1
- data/lib/evostream/event/commands/push_stream.rb +1 -1
- data/lib/evostream/event/commands/set_log_level.rb +1 -1
- data/lib/evostream/event/event/events.rb +2 -2
- data/lib/evostream/event/event/events/in_stream_created.rb +2 -0
- data/lib/evostream/event/event/events/out_stream_created.rb +2 -2
- data/lib/evostream/event/info.rb +2 -2
- data/spec/evostream/{action/action_spec.rb → action_spec.rb} +11 -11
- data/spec/{cli → evostream/cli}/argument/command_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/config_spec.rb +2 -0
- data/spec/evostream/cli/argument/help_spec.rb +26 -0
- data/spec/{cli → evostream/cli}/argument/host_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/port_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/search_spec.rb +2 -0
- data/spec/{cli → evostream/cli}/argument/version_spec.rb +2 -0
- data/spec/evostream/commands/create_dash_spec.rb +3 -3
- data/spec/evostream/commands/create_hls_spec.rb +27 -27
- data/spec/evostream/commands/create_spec.rb +22 -22
- data/spec/evostream/commands/{push_stream_spec.rb → destroy_push_stream_spec.rb} +3 -3
- data/spec/evostream/commands/destroy_spec.rb +6 -6
- data/spec/evostream/commands/get_stream_info_spec.rb +4 -4
- data/spec/evostream/commands/{list_stream_spec.rb → list_streams_spec.rb} +2 -2
- data/spec/evostream/commands/set_log_level_spec.rb +3 -3
- data/spec/evostream/events/events_spec.rb +1 -1
- data/spec/evostream/events/in_stream_closed_spec.rb +82 -0
- data/spec/evostream/events/in_stream_created_spec.rb +75 -0
- data/spec/evostream/events/{request_out_stream_created_spec.rb → out_stream_created_spec.rb} +61 -67
- data/spec/features/push_stream_spec.rb +4 -2
- data/spec/features/remove_config_spec.rb +4 -2
- data/spec/spec_helper.rb +12 -8
- data/spec/support/examples_arguments.rb +5 -0
- data/spec/support/fake_evostream.rb +14 -18
- metadata +64 -83
- data/spec/cli/argument/help_spec.rb +0 -28
- data/spec/evostream/event/event_spec.rb +0 -0
- data/spec/evostream/events/request_in_stream_closed_spec.rb +0 -82
- data/spec/evostream/events/request_in_stream_created_spec.rb +0 -75
@@ -3,80 +3,80 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::Create do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'bandwidths' do
|
9
|
-
let(:arg_value) { Faker::Number.between(1, 99) }
|
8
|
+
context 'when bandwidths' do
|
9
|
+
let(:arg_value) { Faker::Number.between(from: 1, to: 99) }
|
10
10
|
let(:argument) { 'bandwidths' }
|
11
11
|
|
12
12
|
include_examples 'command raise'
|
13
13
|
end
|
14
14
|
|
15
|
-
context 'group_name' do
|
15
|
+
context 'when group_name' do
|
16
16
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
17
17
|
let(:argument) { 'group_name' }
|
18
18
|
|
19
19
|
include_examples 'command raise'
|
20
20
|
end
|
21
21
|
|
22
|
-
context 'playlist_type' do
|
22
|
+
context 'when playlist_type' do
|
23
23
|
let(:arg_value) { %w[appending rolling].sample }
|
24
24
|
let(:argument) { 'playlist_type' }
|
25
25
|
|
26
26
|
include_examples 'command raise'
|
27
27
|
end
|
28
28
|
|
29
|
-
context 'playlist_length' do
|
30
|
-
let(:arg_value) { Faker::Number.between(1, 99) }
|
29
|
+
context 'when playlist_length' do
|
30
|
+
let(:arg_value) { Faker::Number.between(from: 1, to: 99) }
|
31
31
|
let(:argument) { 'playlist_length' }
|
32
32
|
|
33
33
|
include_examples 'command raise'
|
34
34
|
end
|
35
35
|
|
36
|
-
context 'chunk_length' do
|
37
|
-
let(:arg_value) { Faker::Number.between(1, 99) }
|
36
|
+
context 'when chunk_length' do
|
37
|
+
let(:arg_value) { Faker::Number.between(from: 1, to: 99) }
|
38
38
|
let(:argument) { 'chunk_length' }
|
39
39
|
|
40
40
|
include_examples 'command raise'
|
41
41
|
end
|
42
42
|
|
43
|
-
context 'chunk_on_idr', broken: true do
|
44
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
43
|
+
context 'when chunk_on_idr', broken: true do
|
44
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
45
45
|
let(:argument) { 'chunk_on_idr' }
|
46
46
|
|
47
47
|
include_examples 'command raise'
|
48
48
|
end
|
49
49
|
|
50
|
-
context 'keep_alive' do
|
51
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
50
|
+
context 'when keep_alive' do
|
51
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
52
52
|
let(:argument) { 'keep_alive' }
|
53
53
|
|
54
54
|
include_examples 'command raise'
|
55
55
|
end
|
56
56
|
|
57
|
-
context 'overwrite_destination' do
|
58
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
57
|
+
context 'when overwrite_destination' do
|
58
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
59
59
|
let(:argument) { 'overwrite_destination' }
|
60
60
|
|
61
61
|
include_examples 'command raise'
|
62
62
|
end
|
63
63
|
|
64
|
-
context 'stale_retention_count' do
|
65
|
-
let(:arg_value) { Faker::Number.between(1, 99) }
|
64
|
+
context 'when stale_retention_count' do
|
65
|
+
let(:arg_value) { Faker::Number.between(from: 1, to: 99) }
|
66
66
|
let(:argument) { 'stale_retention_count' }
|
67
67
|
|
68
68
|
include_examples 'command raise'
|
69
69
|
end
|
70
70
|
|
71
|
-
context 'cleanup_destination' do
|
72
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
71
|
+
context 'when cleanup_destination' do
|
72
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
73
73
|
let(:argument) { 'cleanup_destination' }
|
74
74
|
|
75
75
|
include_examples 'command raise'
|
76
76
|
end
|
77
77
|
|
78
|
-
context 'dynamic_profile' do
|
79
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
78
|
+
context 'when dynamic_profile' do
|
79
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
80
80
|
let(:argument) { 'dynamic_profile' }
|
81
81
|
|
82
82
|
include_examples 'command raise'
|
@@ -86,7 +86,7 @@ describe Evostream::Commands::Create do
|
|
86
86
|
let(:cmd) do
|
87
87
|
{
|
88
88
|
local_stream_names: Faker::Games::Pokemon.name,
|
89
|
-
target_folder: Faker::File.file_name('/path/to')
|
89
|
+
target_folder: Faker::File.file_name(dir: '/path/to')
|
90
90
|
}
|
91
91
|
end
|
92
92
|
|
@@ -5,20 +5,20 @@ require 'spec_helper'
|
|
5
5
|
describe Evostream::Commands::Destroy do
|
6
6
|
let(:command) { Evostream::Commands::PushStream }
|
7
7
|
|
8
|
-
context 'uri' do
|
8
|
+
context 'when uri' do
|
9
9
|
let(:cmd) { { uri: 'rtmp://de.pscp.tv:80/x/31' } }
|
10
10
|
|
11
11
|
include_examples 'command'
|
12
12
|
end
|
13
13
|
|
14
|
-
context 'local_stream_name' do
|
14
|
+
context 'when local_stream_name' do
|
15
15
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
16
16
|
let(:argument) { 'local_stream_name' }
|
17
17
|
|
18
18
|
include_examples 'command raise'
|
19
19
|
end
|
20
20
|
|
21
|
-
context 'target_stream_name' do
|
21
|
+
context 'when target_stream_name' do
|
22
22
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
23
23
|
let(:argument) { 'target_stream_name' }
|
24
24
|
|
@@ -3,22 +3,22 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::Destroy do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'id' do
|
9
|
-
let(:cmd) { { id: Faker::Number.between(1, 99).to_s } }
|
8
|
+
context 'when id' do
|
9
|
+
let(:cmd) { { id: Faker::Number.between(from: 1, to: 99).to_s } }
|
10
10
|
|
11
11
|
include_examples 'command'
|
12
12
|
end
|
13
13
|
|
14
|
-
context 'remove_hls_hds_files' do
|
15
|
-
let(:arg_value) { Faker::Number.between(0, 1) }
|
14
|
+
context 'when remove_hls_hds_files' do
|
15
|
+
let(:arg_value) { Faker::Number.between(from: 0, to: 1) }
|
16
16
|
let(:argument) { 'remove_hls_hds_files' }
|
17
17
|
|
18
18
|
include_examples 'command raise'
|
19
19
|
end
|
20
20
|
|
21
|
-
context 'group_name' do
|
21
|
+
context 'when group_name' do
|
22
22
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
23
23
|
let(:argument) { 'group_name' }
|
24
24
|
|
@@ -3,15 +3,15 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::GetStreamInfo do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'id' do
|
9
|
-
let(:cmd) { { id: Faker::Number.between(1, 999).to_s } }
|
8
|
+
context 'when id' do
|
9
|
+
let(:cmd) { { id: Faker::Number.between(from: 1, to: 999).to_s } }
|
10
10
|
|
11
11
|
include_examples 'command'
|
12
12
|
end
|
13
13
|
|
14
|
-
context 'local_stream_name' do
|
14
|
+
context 'when local_stream_name' do
|
15
15
|
let(:arg_value) { Faker::Games::Pokemon.name }
|
16
16
|
let(:argument) { 'local_stream_name' }
|
17
17
|
|
@@ -3,9 +3,9 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::ListStreams do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'disable_internal_streams' do
|
8
|
+
context 'when disable_internal_streams' do
|
9
9
|
let(:cmd) { { disable_internal_streams: Faker::Boolean.boolean.to_s } }
|
10
10
|
|
11
11
|
include_examples 'command'
|
@@ -3,10 +3,10 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Evostream::Commands::SetLogLevel do
|
6
|
-
let(:command) {
|
6
|
+
let(:command) { described_class }
|
7
7
|
|
8
|
-
context 'level' do
|
9
|
-
let(:cmd) { { level: Faker::Number.between(0, 6).to_s } }
|
8
|
+
context 'when level' do
|
9
|
+
let(:cmd) { { level: Faker::Number.between(from: 0, to: 6).to_s } }
|
10
10
|
|
11
11
|
include_examples 'command'
|
12
12
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Evostream::Events::InStreamClosed, type: :request do
|
6
|
+
let(:name_stream) do
|
7
|
+
"#{Evostream::Service.name}#{Faker::Number.between(from: 1, to: 999)}"
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:body) do
|
11
|
+
{
|
12
|
+
id: Faker::Number.between(from: 1, to: 999_999),
|
13
|
+
payload: {
|
14
|
+
PID: Faker::Number.between(from: 1, to: 999_999),
|
15
|
+
appName: 'evostreamms',
|
16
|
+
audio: {
|
17
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
18
|
+
codec: 'AAAC',
|
19
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999),
|
20
|
+
droppedBytesCount: 0,
|
21
|
+
droppedPacketsCount: 0,
|
22
|
+
packetsCount: Faker::Number.between(from: 1, to: 999_999)
|
23
|
+
},
|
24
|
+
bandwidth: Faker::Number.between(from: 1, to: 999_999),
|
25
|
+
connectionType: 0,
|
26
|
+
creationTimestamp: Faker::Number.decimal(l_digits: 2),
|
27
|
+
customData: nil,
|
28
|
+
farIp: Faker::Internet.ip_v4_address,
|
29
|
+
farPort: Faker::Number.between(from: 1, to: 65_536),
|
30
|
+
ip: Faker::Internet.ip_v4_address,
|
31
|
+
name: name_stream,
|
32
|
+
nearIp: Faker::Internet.ip_v4_address,
|
33
|
+
nearPort: Faker::Number.between(from: 1, to: 65_536),
|
34
|
+
outStreamsUniqueIds: [
|
35
|
+
4,
|
36
|
+
5
|
37
|
+
],
|
38
|
+
port: Faker::Number.between(from: 1, to: 65_536),
|
39
|
+
processId: Faker::Number.between(from: 1, to: 999),
|
40
|
+
processType: 'origin',
|
41
|
+
queryTimestamp: Faker::Number.decimal(l_digits: 3),
|
42
|
+
type: 'INP',
|
43
|
+
typeNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
44
|
+
uniqueId: 2,
|
45
|
+
upTime: Faker::Number.decimal(l_digits: 3),
|
46
|
+
userAgent: 'Lavf56.40.101',
|
47
|
+
video: {
|
48
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
49
|
+
codec: 'VH264',
|
50
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
51
|
+
droppedBytesCount: 0,
|
52
|
+
droppedPacketsCount: 0,
|
53
|
+
height: Faker::Number.between(from: 1, to: 999),
|
54
|
+
level: Faker::Number.between(from: 1, to: 999),
|
55
|
+
packetsCount: Faker::Number.between(from: 1, to: 999),
|
56
|
+
profile: Faker::Number.between(from: 1, to: 999),
|
57
|
+
width: Faker::Number.between(from: 1, to: 999)
|
58
|
+
}
|
59
|
+
},
|
60
|
+
processId: Faker::Number.between(from: 1, to: 999_999),
|
61
|
+
timestamp: Faker::Number.between(from: 1, to: 999_999),
|
62
|
+
type: 'inStreamClosed'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
let(:type_default) { 'inStreamClosed' }
|
67
|
+
|
68
|
+
context 'when payload is correct' do
|
69
|
+
let(:type) { body[:type] }
|
70
|
+
let(:payload) { body[:payload] }
|
71
|
+
|
72
|
+
include_examples 'payload is correct'
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'when payload isn\'t correct' do
|
76
|
+
let(:body) { Faker::Lorem.paragraph }
|
77
|
+
let(:type) { Faker::Games::Zelda.character }
|
78
|
+
let(:payload) { Faker::Games::Zelda.game }
|
79
|
+
|
80
|
+
include_examples 'payload isn\'t correct'
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Evostream::Events::InStreamCreated, type: :request do
|
6
|
+
let(:body) do
|
7
|
+
{
|
8
|
+
id: Faker::Number.between(from: 1, to: 999_999),
|
9
|
+
payload: {
|
10
|
+
PID: Faker::Number.between(from: 1, to: 999_999),
|
11
|
+
appName: 'evostreamms',
|
12
|
+
audio: {
|
13
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
14
|
+
codec: 'AAAC',
|
15
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999),
|
16
|
+
droppedBytesCount: 0,
|
17
|
+
droppedPacketsCount: 0,
|
18
|
+
packetsCount: Faker::Number.between(from: 1, to: 999_999)
|
19
|
+
},
|
20
|
+
bandwidth: Faker::Number.between(from: 1, to: 999_999),
|
21
|
+
connectionType: 0,
|
22
|
+
creationTimestamp: Faker::Number.decimal(l_digits: 2),
|
23
|
+
customData: nil,
|
24
|
+
farIp: Faker::Internet.ip_v4_address,
|
25
|
+
farPort: Faker::Number.between(from: 1, to: 65_536),
|
26
|
+
ip: Faker::Internet.ip_v4_address,
|
27
|
+
name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(from: 1, to: 999)}",
|
28
|
+
nearIp: Faker::Internet.ip_v4_address,
|
29
|
+
nearPort: Faker::Number.between(from: 1, to: 65_536),
|
30
|
+
outStreamsUniqueIds: nil,
|
31
|
+
port: Faker::Number.between(from: 1, to: 65_536),
|
32
|
+
processId: Faker::Number.between(from: 1, to: 999),
|
33
|
+
processType: 'origin',
|
34
|
+
queryTimestamp: Faker::Number.decimal(l_digits: 3),
|
35
|
+
type: 'INP',
|
36
|
+
typeNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
37
|
+
uniqueId: 2,
|
38
|
+
upTime: Faker::Number.decimal(l_digits: 3),
|
39
|
+
userAgent: 'Lavf56.40.101',
|
40
|
+
video: {
|
41
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
42
|
+
codec: 'VH264',
|
43
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
44
|
+
droppedBytesCount: 0,
|
45
|
+
droppedPacketsCount: 0,
|
46
|
+
height: Faker::Number.between(from: 1, to: 999),
|
47
|
+
level: Faker::Number.between(from: 1, to: 999),
|
48
|
+
packetsCount: Faker::Number.between(from: 1, to: 999),
|
49
|
+
profile: Faker::Number.between(from: 1, to: 999),
|
50
|
+
width: Faker::Number.between(from: 1, to: 999)
|
51
|
+
}
|
52
|
+
},
|
53
|
+
processId: Faker::Number.between(from: 1, to: 999_999),
|
54
|
+
timestamp: Faker::Number.between(from: 1, to: 999_999),
|
55
|
+
type: 'inStreamCreated'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
let(:type_default) { 'inStreamCreated' }
|
60
|
+
|
61
|
+
context 'when payload is correct' do
|
62
|
+
let(:type) { body[:type] }
|
63
|
+
let(:payload) { body[:payload] }
|
64
|
+
|
65
|
+
include_examples 'payload is correct'
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'when payload isn\'t correct' do
|
69
|
+
let(:body) { Faker::Lorem.paragraph }
|
70
|
+
let(:type) { Faker::Games::Zelda.character }
|
71
|
+
let(:payload) { Faker::Games::Zelda.game }
|
72
|
+
|
73
|
+
include_examples 'payload isn\'t correct'
|
74
|
+
end
|
75
|
+
end
|
data/spec/evostream/events/{request_out_stream_created_spec.rb → out_stream_created_spec.rb}
RENAMED
@@ -5,29 +5,29 @@ require 'spec_helper'
|
|
5
5
|
describe Evostream::Events::OutStreamCreated do
|
6
6
|
let(:type_default) { 'outStreamCreated' }
|
7
7
|
|
8
|
-
context 'HLS Flux' do
|
8
|
+
context 'with HLS Flux' do
|
9
9
|
let(:body) do
|
10
10
|
{
|
11
|
-
id: Faker::Number.between(1, 999_999),
|
11
|
+
id: Faker::Number.between(from: 1, to: 999_999),
|
12
12
|
payload: {
|
13
|
-
PID: Faker::Number.between(1, 999_999),
|
13
|
+
PID: Faker::Number.between(from: 1, to: 999_999),
|
14
14
|
appName: 'evostreamms',
|
15
15
|
audio: {
|
16
|
-
bytesCount: Faker::Number.between(1, 999_999),
|
16
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
17
17
|
codec: 'AAAC',
|
18
|
-
codecNumeric: Faker::Number.between(1, 999_999),
|
18
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999),
|
19
19
|
droppedBytesCount: 0,
|
20
20
|
droppedPacketsCount: 0,
|
21
|
-
packetsCount: Faker::Number.between(1, 999_999)
|
21
|
+
packetsCount: Faker::Number.between(from: 1, to: 999_999)
|
22
22
|
},
|
23
|
-
bandwidth: Faker::Number.between(1, 999_999),
|
23
|
+
bandwidth: Faker::Number.between(from: 1, to: 999_999),
|
24
24
|
connectionType: 0,
|
25
|
-
creationTimestamp: Faker::Number.decimal(2),
|
25
|
+
creationTimestamp: Faker::Number.decimal(l_digits: 2),
|
26
26
|
customData: nil,
|
27
27
|
farIp: Faker::Internet.ip_v4_address,
|
28
|
-
farPort: Faker::Number.between(1, 65_536),
|
28
|
+
farPort: Faker::Number.between(from: 1, to: 65_536),
|
29
29
|
hlsSettings: {
|
30
|
-
AESKeyCount: Faker::Number.between(1, 99),
|
30
|
+
AESKeyCount: Faker::Number.between(from: 1, to: 99),
|
31
31
|
audioOnly: false,
|
32
32
|
bandwidth: 0,
|
33
33
|
chunkBaseName: 'segment',
|
@@ -40,14 +40,12 @@ describe Evostream::Events::OutStreamCreated do
|
|
40
40
|
drmType: 'none',
|
41
41
|
fileLength: 0,
|
42
42
|
groupName: Faker::Lorem.word,
|
43
|
-
groupTargetFolder: Faker::File.file_name(Faker::Lorem.word),
|
43
|
+
groupTargetFolder: Faker::File.file_name(dir: Faker::Lorem.word),
|
44
44
|
hlsResume: false,
|
45
45
|
hlsVersion: 3,
|
46
46
|
keepAlive: true,
|
47
47
|
localStreamName: Faker::TvShows::GameOfThrones.house,
|
48
|
-
masterPlaylistPath: Faker::File.file_name(Faker::Lorem.word,
|
49
|
-
Faker::TvShows::GameOfThrones.city,
|
50
|
-
Faker::Color.color_name),
|
48
|
+
masterPlaylistPath: Faker::File.file_name(dir: Faker::Lorem.word, name: Faker::TvShows::GameOfThrones.city, ext: Faker::Color.color_name),
|
51
49
|
maxChunkLength: 0,
|
52
50
|
offsetTime: 0,
|
53
51
|
operationType: 3,
|
@@ -57,47 +55,45 @@ describe Evostream::Events::OutStreamCreated do
|
|
57
55
|
playlistType: %w[rolling appending].sample,
|
58
56
|
staleRetentionCount: 5,
|
59
57
|
startOffset: 0,
|
60
|
-
targetFolder: Faker::File.file_name(Faker::Lorem.word,
|
61
|
-
|
62
|
-
Faker::Color.color_name),
|
63
|
-
timestamp: Faker::Number.decimal(1),
|
58
|
+
targetFolder: Faker::File.file_name(dir: Faker::Lorem.word, name: Faker::TvShows::GameOfThrones.city, ext: Faker::Color.color_name),
|
59
|
+
timestamp: Faker::Number.decimal(l_digits: 1),
|
64
60
|
useByteRange: false,
|
65
61
|
useSystemTime: false
|
66
62
|
},
|
67
63
|
ip: Faker::Internet.ip_v4_address,
|
68
|
-
name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(1, 999)}",
|
64
|
+
name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(from: 1, to: 999)}",
|
69
65
|
nearIp: Faker::Internet.ip_v4_address,
|
70
|
-
nearPort: Faker::Number.between(1, 65_536),
|
66
|
+
nearPort: Faker::Number.between(from: 1, to: 65_536),
|
71
67
|
outStreamsUniqueIds: nil,
|
72
|
-
port: Faker::Number.between(1, 65_536),
|
73
|
-
processId: Faker::Number.between(1, 999),
|
68
|
+
port: Faker::Number.between(from: 1, to: 65_536),
|
69
|
+
processId: Faker::Number.between(from: 1, to: 999),
|
74
70
|
processType: 'origin',
|
75
|
-
queryTimestamp: Faker::Number.decimal(3),
|
71
|
+
queryTimestamp: Faker::Number.decimal(l_digits: 3),
|
76
72
|
type: 'INP',
|
77
|
-
typeNumeric: Faker::Number.between(1, 999_999_999),
|
73
|
+
typeNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
78
74
|
uniqueId: 2,
|
79
|
-
upTime: Faker::Number.decimal(3),
|
75
|
+
upTime: Faker::Number.decimal(l_digits: 3),
|
80
76
|
userAgent: 'Lavf56.40.101',
|
81
77
|
video: {
|
82
|
-
bytesCount: Faker::Number.between(1, 999_999),
|
78
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
83
79
|
codec: 'VH264',
|
84
|
-
codecNumeric: Faker::Number.between(1, 999_999_999),
|
80
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
85
81
|
droppedBytesCount: 0,
|
86
82
|
droppedPacketsCount: 0,
|
87
|
-
height: Faker::Number.between(1, 999),
|
88
|
-
level: Faker::Number.between(1, 999),
|
89
|
-
packetsCount: Faker::Number.between(1, 999),
|
90
|
-
profile: Faker::Number.between(1, 999),
|
91
|
-
width: Faker::Number.between(1, 999)
|
83
|
+
height: Faker::Number.between(from: 1, to: 999),
|
84
|
+
level: Faker::Number.between(from: 1, to: 999),
|
85
|
+
packetsCount: Faker::Number.between(from: 1, to: 999),
|
86
|
+
profile: Faker::Number.between(from: 1, to: 999),
|
87
|
+
width: Faker::Number.between(from: 1, to: 999)
|
92
88
|
}
|
93
89
|
},
|
94
|
-
processId: Faker::Number.between(1, 999_999),
|
95
|
-
timestamp: Faker::Number.between(1, 999_999),
|
90
|
+
processId: Faker::Number.between(from: 1, to: 999_999),
|
91
|
+
timestamp: Faker::Number.between(from: 1, to: 999_999),
|
96
92
|
type: 'outStreamCreated'
|
97
93
|
}
|
98
94
|
end
|
99
95
|
|
100
|
-
context 'payload is correct' do
|
96
|
+
context 'when payload is correct' do
|
101
97
|
let(:type) { body[:type] }
|
102
98
|
let(:payload) { body[:payload] }
|
103
99
|
let(:type_stream) { 'Hls' }
|
@@ -105,7 +101,7 @@ describe Evostream::Events::OutStreamCreated do
|
|
105
101
|
include_examples 'payload is correct', false
|
106
102
|
end
|
107
103
|
|
108
|
-
context 'payload isn\'t correct' do
|
104
|
+
context 'when payload isn\'t correct' do
|
109
105
|
let(:body) { Faker::Lorem.paragraph }
|
110
106
|
let(:type) { Faker::Games::Zelda.character }
|
111
107
|
let(:payload) { Faker::Games::Zelda.game }
|
@@ -114,27 +110,27 @@ describe Evostream::Events::OutStreamCreated do
|
|
114
110
|
end
|
115
111
|
end
|
116
112
|
|
117
|
-
context 'DASH Flux' do
|
113
|
+
context 'with DASH Flux' do
|
118
114
|
let(:body) do
|
119
115
|
{
|
120
|
-
id: Faker::Number.between(1, 999_999),
|
116
|
+
id: Faker::Number.between(from: 1, to: 999_999),
|
121
117
|
payload: {
|
122
|
-
PID: Faker::Number.between(1, 999_999),
|
118
|
+
PID: Faker::Number.between(from: 1, to: 999_999),
|
123
119
|
appName: 'evostreamms',
|
124
120
|
audio: {
|
125
|
-
bytesCount: Faker::Number.between(1, 999_999),
|
121
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
126
122
|
codec: 'AAAC',
|
127
|
-
codecNumeric: Faker::Number.between(1, 999_999),
|
123
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999),
|
128
124
|
droppedBytesCount: 0,
|
129
125
|
droppedPacketsCount: 0,
|
130
|
-
packetsCount: Faker::Number.between(1, 999_999)
|
126
|
+
packetsCount: Faker::Number.between(from: 1, to: 999_999)
|
131
127
|
},
|
132
|
-
bandwidth: Faker::Number.between(1, 999_999),
|
128
|
+
bandwidth: Faker::Number.between(from: 1, to: 999_999),
|
133
129
|
connectionType: 0,
|
134
|
-
creationTimestamp: Faker::Number.decimal(2),
|
130
|
+
creationTimestamp: Faker::Number.decimal(l_digits: 2),
|
135
131
|
customData: nil,
|
136
132
|
farIp: Faker::Internet.ip_v4_address,
|
137
|
-
farPort: Faker::Number.between(1, 65_536),
|
133
|
+
farPort: Faker::Number.between(from: 1, to: 65_536),
|
138
134
|
dashSettings: {
|
139
135
|
bandwidth: 0,
|
140
136
|
chunkBaseName: 'dummy',
|
@@ -144,7 +140,7 @@ describe Evostream::Events::OutStreamCreated do
|
|
144
140
|
configId: 2,
|
145
141
|
dynamicProfile: true,
|
146
142
|
groupName: Faker::Lorem.word,
|
147
|
-
groupTargetFolder: Faker::File.file_name(Faker::Lorem.word),
|
143
|
+
groupTargetFolder: Faker::File.file_name(dir: Faker::Lorem.word),
|
148
144
|
keepAlive: true,
|
149
145
|
localStreamName: Faker::TvShows::GameOfThrones.house,
|
150
146
|
manifestName: "#{Faker::Lorem.word}.#{Faker::Lorem.word}",
|
@@ -153,44 +149,42 @@ describe Evostream::Events::OutStreamCreated do
|
|
153
149
|
playlistLength: 5,
|
154
150
|
playlistType: %w[rolling appending].sample,
|
155
151
|
staleRetentionCount: 5,
|
156
|
-
targetFolder: Faker::File.file_name(Faker::Lorem.word,
|
157
|
-
Faker::TvShows::GameOfThrones.city,
|
158
|
-
Faker::Color.color_name)
|
152
|
+
targetFolder: Faker::File.file_name(dir: Faker::Lorem.word, name: Faker::TvShows::GameOfThrones.city, ext: Faker::Color.color_name)
|
159
153
|
},
|
160
154
|
ip: Faker::Internet.ip_v4_address,
|
161
|
-
name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(1, 999)}",
|
155
|
+
name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(from: 1, to: 999)}",
|
162
156
|
nearIp: Faker::Internet.ip_v4_address,
|
163
|
-
nearPort: Faker::Number.between(1, 65_536),
|
157
|
+
nearPort: Faker::Number.between(from: 1, to: 65_536),
|
164
158
|
outStreamsUniqueIds: nil,
|
165
|
-
port: Faker::Number.between(1, 65_536),
|
166
|
-
processId: Faker::Number.between(1, 999),
|
159
|
+
port: Faker::Number.between(from: 1, to: 65_536),
|
160
|
+
processId: Faker::Number.between(from: 1, to: 999),
|
167
161
|
processType: 'origin',
|
168
|
-
queryTimestamp: Faker::Number.decimal(3),
|
162
|
+
queryTimestamp: Faker::Number.decimal(l_digits: 3),
|
169
163
|
type: 'INP',
|
170
|
-
typeNumeric: Faker::Number.between(1, 999_999_999),
|
164
|
+
typeNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
171
165
|
uniqueId: 2,
|
172
|
-
upTime: Faker::Number.decimal(3),
|
166
|
+
upTime: Faker::Number.decimal(l_digits: 3),
|
173
167
|
userAgent: 'Lavf56.40.101',
|
174
168
|
video: {
|
175
|
-
bytesCount: Faker::Number.between(1, 999_999),
|
169
|
+
bytesCount: Faker::Number.between(from: 1, to: 999_999),
|
176
170
|
codec: 'VH264',
|
177
|
-
codecNumeric: Faker::Number.between(1, 999_999_999),
|
171
|
+
codecNumeric: Faker::Number.between(from: 1, to: 999_999_999),
|
178
172
|
droppedBytesCount: 0,
|
179
173
|
droppedPacketsCount: 0,
|
180
|
-
height: Faker::Number.between(1, 999),
|
181
|
-
level: Faker::Number.between(1, 999),
|
182
|
-
packetsCount: Faker::Number.between(1, 999),
|
183
|
-
profile: Faker::Number.between(1, 999),
|
184
|
-
width: Faker::Number.between(1, 999)
|
174
|
+
height: Faker::Number.between(from: 1, to: 999),
|
175
|
+
level: Faker::Number.between(from: 1, to: 999),
|
176
|
+
packetsCount: Faker::Number.between(from: 1, to: 999),
|
177
|
+
profile: Faker::Number.between(from: 1, to: 999),
|
178
|
+
width: Faker::Number.between(from: 1, to: 999)
|
185
179
|
}
|
186
180
|
},
|
187
|
-
processId: Faker::Number.between(1, 999_999),
|
188
|
-
timestamp: Faker::Number.between(1, 999_999),
|
181
|
+
processId: Faker::Number.between(from: 1, to: 999_999),
|
182
|
+
timestamp: Faker::Number.between(from: 1, to: 999_999),
|
189
183
|
type: 'outStreamCreated'
|
190
184
|
}
|
191
185
|
end
|
192
186
|
|
193
|
-
context 'payload is correct' do
|
187
|
+
context 'when payload is correct' do
|
194
188
|
let(:type) { body[:type] }
|
195
189
|
let(:payload) { body[:payload] }
|
196
190
|
let(:type_stream) { 'Dash' }
|
@@ -198,7 +192,7 @@ describe Evostream::Events::OutStreamCreated do
|
|
198
192
|
include_examples 'payload is correct', false
|
199
193
|
end
|
200
194
|
|
201
|
-
context 'payload isn\'t correct' do
|
195
|
+
context 'when payload isn\'t correct' do
|
202
196
|
let(:body) { Faker::Lorem.paragraph }
|
203
197
|
let(:type) { Faker::Games::Zelda.character }
|
204
198
|
let(:payload) { Faker::Games::Zelda.game }
|