mu 5.7.33 → 5.7.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -293,14 +293,15 @@ class Mu
293
293
  filename = "app_id_stats.csv"
294
294
  msg "Update stats to: #{File.expand_path(filename)}", Logger::INFO
295
295
  unless File.exists?(filename)
296
- heading = "scenario,executed,errors,timeouts,client_tx_bytes,client_tx_msgs,client_tx_bitrate,client_rx_bytes,client_rx_msgs,client_rx_bitrate,server_tx_bytes,server_tx_msgs,server_tx_bitrate,server_rx_bytes,server_rx_msgs,server_rx_bitrate,total_instances,max_active_tcp_connections"
296
+ heading = "scenario,executed,errors,timeouts,client_tx_bytes,client_tx_msgs,client_tx_bitrate,client_rx_bytes,client_rx_msgs,client_rx_bitrate,server_tx_bytes,server_tx_msgs,server_tx_bitrate,server_rx_bytes,server_rx_msgs,server_rx_bitrate,total_instances,max_active_tcp_connections,verify_response"
297
297
  File.open(filename, 'a'){|f| f.puts(heading)}
298
298
  end
299
299
  @row = [msl_file,@executed,@errors,@timeouts,
300
300
  @client_tx_bytes,@client_tx_msgs,@client_tx_bitrate,
301
301
  @client_rx_bytes,@client_rx_msgs,@client_rx_bitrate,
302
302
  @server_tx_bytes,@server_tx_msgs,@server_tx_bitrate,
303
- @server_rx_bytes,@server_rx_msgs,@server_rx_bitrate,@total_instances,@max_active_tcp_connections ]
303
+ @server_rx_bytes,@server_rx_msgs,@server_rx_bitrate,
304
+ @total_instances,@max_active_tcp_connections,@verify_response]
304
305
  File.open(filename, 'a'){|f| f.puts(@row.join(','))}
305
306
  end
306
307
 
data/lib/mu/har.rb CHANGED
@@ -240,7 +240,8 @@ class Har
240
240
  cs.block('struct [',']') do
241
241
  cs.string(param['name'] + '=')
242
242
  cs.block('uri_percent_encode [',']') do
243
- cs.string Regexp.escape(param['value'])
243
+ # This is so we correctly escape strange unicode characters
244
+ cs.string Regexp.escape(param['value'].bytes.to_a.map(&:chr).join.inspect)
244
245
  end
245
246
  end
246
247
  end
@@ -393,7 +394,7 @@ class Har
393
394
  elsif(header['name'] === 'Content-Encoding')
394
395
  # Check out content encoding
395
396
  # We can do GZIP
396
- if header['value'] == HTTP_GZIP_CONTENT_ENCODING
397
+ if header['value'] == HTTP_GZIP_CONTENT_ENCODING or header['value'] == HTTP_DEFLATE_CONTENT_ENCODING
397
398
  content_encoding = true
398
399
  else
399
400
  raise NotImplementedError, "Content-Encoding: #{header['value']}"
@@ -415,13 +416,17 @@ class Har
415
416
  # If we need to replace the content with a special repeated field
416
417
  if @options.strip_large_content
417
418
  body = []
418
-
419
- if req_res['content']['size'] > @options.large_content_size
420
- # Take first 1K bytes from the content and repeat
421
- body << payload[0, HTTP_CONTENT_SLICE_SIZE]
419
+ if req_res.has_key?('content')
420
+ if req_res['content']['size'] > @options.large_content_size
421
+ # Take first 1K bytes from the content and repeat
422
+ body << payload[0, HTTP_CONTENT_SLICE_SIZE]
423
+ else
424
+ # Set response body
425
+ body << payload
426
+ end
422
427
  else
423
- # Set response body
424
- body << payload
428
+ # If the content is empty no need to strip it
429
+ return
425
430
  end
426
431
 
427
432
  # Yes calculate the number of 1K chunks we need to inject
@@ -447,8 +452,12 @@ class Har
447
452
  end
448
453
  cs_send.literal_no_format("\"");
449
454
  else
450
- payload.gsub!(/#\{|##\{/, "\\x23{")
451
- cs_send.literal_no_format("\"" + self.escape(payload) + "\"")
455
+ # If the payload contains a string that looks like it will require ruby variable interpolation #{} => \x23{} when escaped
456
+ if(payload =~ /#\{.*}/)
457
+ new_payload = payload.split(/#\{/).join("#\"\n\"{")
458
+ payload = new_payload
459
+ end
460
+ cs_send.literal("\"" + self.escape(payload) + "\"")
452
461
  end
453
462
 
454
463
 
@@ -497,6 +506,9 @@ class Har
497
506
 
498
507
  # Takes input and a table that maps ascii codes to their representation
499
508
  def escape input, escapes=nil
509
+ #output = input.bytes.to_a.map(&:chr).join.inspect
510
+ #return output
511
+
500
512
  escapes ||= ESCAPES
501
513
  output = []
502
514
  input.each_byte do |i|
data/lib/mu/maker.rb CHANGED
@@ -12,6 +12,7 @@ class Maker
12
12
  scenario.create(name) do
13
13
  yield scenario
14
14
  end
15
+ scenario.musl << "\r\n"
15
16
  return scenario.musl.join
16
17
  end
17
18
 
data/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION='5.7.33'
1
+ VERSION='5.7.34'
metadata CHANGED
@@ -1,148 +1,158 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mu
3
- version: !ruby/object:Gem::Version
4
- version: 5.7.33
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 5.7.34
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - MuEng
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-12 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-08-03 00:00:00 -05:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
15
17
  name: nokogiri
16
- requirement: &21107060 !ruby/object:Gem::Requirement
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
17
20
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
21
24
  version: 1.4.4
22
25
  type: :runtime
23
- prerelease: false
24
- version_requirements: *21107060
25
- - !ruby/object:Gem::Dependency
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
26
28
  name: rest-client
27
- requirement: &21106460 !ruby/object:Gem::Requirement
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
28
31
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
32
35
  version: 1.6.1
33
36
  type: :runtime
34
- prerelease: false
35
- version_requirements: *21106460
36
- - !ruby/object:Gem::Dependency
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
37
39
  name: mime-types
38
- requirement: &21105860 !ruby/object:Gem::Requirement
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
39
42
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '1.16'
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "1.16"
44
47
  type: :runtime
45
- prerelease: false
46
- version_requirements: *21105860
47
- - !ruby/object:Gem::Dependency
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
48
50
  name: json
49
- requirement: &21105340 !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
50
53
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
55
58
  type: :runtime
56
- prerelease: false
57
- version_requirements: *21105340
58
- - !ruby/object:Gem::Dependency
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
59
61
  name: hexy
60
- requirement: &21104680 !ruby/object:Gem::Requirement
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
61
64
  none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
65
68
  version: 0.1.1
66
69
  type: :runtime
67
- prerelease: false
68
- version_requirements: *21104680
69
- - !ruby/object:Gem::Dependency
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
70
72
  name: uuid
71
- requirement: &21104060 !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
72
75
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
76
79
  version: 2.0.2
77
80
  type: :runtime
78
- prerelease: false
79
- version_requirements: *21104060
80
- description: ! "The Mu gem allows users to include mu libraries within scripts\n that
81
- interact with mu appliance software. The gem also supplies command line interfaces\n
82
- \ to many of these same libraries"
83
- email:
81
+ version_requirements: *id006
82
+ description: |-
83
+ The Mu gem allows users to include mu libraries within scripts
84
+ that interact with mu appliance software. The gem also supplies command line interfaces
85
+ to many of these same libraries
86
+ email:
84
87
  - info@mudynamics.com
85
- executables:
88
+ executables:
86
89
  - mu
87
90
  extensions: []
91
+
88
92
  extra_rdoc_files: []
89
- files:
90
- - lib/mu.rb
91
- - lib/mu/har.rb
92
- - lib/mu/http_helper.rb
93
- - lib/mu/client.rb
94
- - lib/mu/api/netconfig.rb
95
- - lib/mu/api/muapi.rb
93
+
94
+ files:
95
+ - lib/mu/api/ddt.rb
96
96
  - lib/mu/api/homepage.rb
97
- - lib/mu/api/system.rb
97
+ - lib/mu/api/muapi.rb
98
+ - lib/mu/api/netconfig.rb
98
99
  - lib/mu/api/scale.rb
99
- - lib/mu/api/ddt.rb
100
- - lib/mu/helper.rb
101
- - lib/mu/maker.rb
102
- - lib/mu/command/cmd_homepage.rb
100
+ - lib/mu/api/system.rb
101
+ - lib/mu/client.rb
103
102
  - lib/mu/command/api.rb
104
103
  - lib/mu/command/cmd_ddt.rb
105
- - lib/mu/command/cmd_scale.rb
106
- - lib/mu/command/curl.rb
104
+ - lib/mu/command/cmd_homepage.rb
107
105
  - lib/mu/command/cmd_muapi.rb
108
- - lib/mu/command/help.rb
109
106
  - lib/mu/command/cmd_musl.rb
110
- - lib/mu/command/cmd_system.rb
107
+ - lib/mu/command/cmd_netconfig.rb
108
+ - lib/mu/command/cmd_runanalysis.rb
111
109
  - lib/mu/command/cmd_runscale.rb
112
110
  - lib/mu/command/cmd_runscenario.rb
113
- - lib/mu/command/cmd_runanalysis.rb
114
- - lib/mu/command/cmd_netconfig.rb
115
111
  - lib/mu/command/cmd_runverify.rb
112
+ - lib/mu/command/cmd_scale.rb
113
+ - lib/mu/command/cmd_system.rb
114
+ - lib/mu/command/curl.rb
115
+ - lib/mu/command/help.rb
116
116
  - lib/mu/command.rb
117
117
  - lib/mu/curl/error.rb
118
118
  - lib/mu/curl/verify.rb
119
+ - lib/mu/har.rb
120
+ - lib/mu/helper.rb
121
+ - lib/mu/http_helper.rb
122
+ - lib/mu/maker.rb
123
+ - lib/mu.rb
119
124
  - bin/mu
120
125
  - Mu_Gem.html
121
126
  - version.rb
122
127
  - LICENSE.txt
123
128
  - README.rdoc
129
+ has_rdoc: true
124
130
  homepage: http://www.mudynamics.com
125
131
  licenses: []
132
+
126
133
  post_install_message:
127
134
  rdoc_options: []
128
- require_paths:
135
+
136
+ require_paths:
129
137
  - lib
130
- required_ruby_version: !ruby/object:Gem::Requirement
138
+ required_ruby_version: !ruby/object:Gem::Requirement
131
139
  none: false
132
- requirements:
133
- - - ! '>='
134
- - !ruby/object:Gem::Version
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
135
143
  version: 1.8.7
136
- required_rubygems_version: !ruby/object:Gem::Requirement
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
145
  none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: "0"
142
150
  requirements: []
151
+
143
152
  rubyforge_project:
144
- rubygems_version: 1.8.5
153
+ rubygems_version: 1.6.2
145
154
  signing_key:
146
155
  specification_version: 3
147
156
  summary: Mu Dynamics General Purpose Library and Command Line Tool
148
157
  test_files: []
158
+