content_server 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/content_data/content_data.rb +194 -56
- data/lib/content_data/version.rb +1 -1
- data/lib/content_server/backup_server.rb +4 -27
- data/lib/content_server/content_server.rb +3 -27
- data/lib/content_server/file_streamer.rb +2 -0
- data/lib/content_server/remote_content.rb +1 -2
- data/lib/content_server/server.rb +23 -3
- data/lib/content_server/version.rb +1 -1
- data/lib/email/version.rb +1 -1
- data/lib/file_copy/version.rb +1 -1
- data/lib/file_indexing/index_agent.rb +1 -1
- data/lib/file_indexing/version.rb +1 -1
- data/lib/file_monitoring/file_monitoring.rb +45 -32
- data/lib/file_monitoring/monitor_path.rb +219 -181
- data/lib/file_monitoring/version.rb +1 -1
- data/lib/file_utils/file_generator/file_generator.rb +1 -1
- data/lib/file_utils/file_utils.rb +2 -2
- data/lib/file_utils/version.rb +1 -1
- data/lib/log/version.rb +1 -1
- data/lib/networking/version.rb +1 -1
- data/lib/params/version.rb +1 -1
- data/lib/process_monitoring/version.rb +1 -1
- data/lib/run_in_background/version.rb +1 -1
- data/lib/testing_memory/testing_memory.rb +1 -1
- data/lib/testing_server/testing_server.rb +1 -1
- data/lib/testing_server/version.rb +1 -1
- data/spec/content_data/validations_spec.rb +2 -2
- data/spec/content_server/file_streamer_spec.rb +5 -0
- data/spec/networking/tcp_spec.rb +1 -3
- data/spec/validations/index_validations_spec.rb +2 -2
- data/test/content_data/content_data_test.rb +8 -7
- data/test/file_generator/file_generator_spec.rb +3 -2
- data/test/file_monitoring/monitor_path_test.rb +38 -4
- data/test/file_utils/fileutil_mksymlink_test.rb +9 -0
- data/test/file_utils/time_modification_test.rb +6 -2
- data/test/run_in_background/test_app +17 -15
- metadata +2 -93
- data/lib/content_server/queue_indexer.rb +0 -86
- data/test/file_indexing/index_agent_test.rb +0 -51
- data/test/file_indexing/index_agent_test/New.txt +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libexslt.dll +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libxslt.dll +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/xsltproc.exe +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exslt.h +0 -102
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltconfig.h +0 -73
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltexports.h +0 -140
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/libexslt.h +0 -29
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/attributes.h +0 -38
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/documents.h +0 -93
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extensions.h +0 -262
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extra.h +0 -80
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/functions.h +0 -78
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/imports.h +0 -75
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/keys.h +0 -53
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/libxslt.h +0 -30
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/namespaces.h +0 -68
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/numbersInternals.h +0 -69
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/pattern.h +0 -81
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/preproc.h +0 -43
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/security.h +0 -104
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/templates.h +0 -77
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/transform.h +0 -207
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/trio.h +0 -216
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/triodef.h +0 -220
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/variables.h +0 -91
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/win32config.h +0 -101
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xslt.h +0 -103
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltInternals.h +0 -1967
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltconfig.h +0 -172
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltexports.h +0 -142
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltlocale.h +0 -57
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltutils.h +0 -309
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltwin32config.h +0 -105
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt.lib +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt_a.lib +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt.lib +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt_a.lib +0 -0
- data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/readme.txt +0 -22
- data/test/file_indexing/index_agent_test/patterns.input +0 -3
- data/test/file_monitoring/file_monitoring_test.rb +0 -0
- data/test/file_monitoring/file_monitoring_test/conf.yml +0 -4
- data/test/file_monitoring/file_monitoring_test/conf_win32.yml +0 -5
- data/test/file_monitoring/file_monitoring_test/log +0 -56
|
@@ -16,7 +16,7 @@ module FileGenerator
|
|
|
16
16
|
Params.string('dir_name_prefix', 'test_dir_4_backup_server',
|
|
17
17
|
'Represents the directory name template for generated file')
|
|
18
18
|
Params.integer('file_size_in_bytes', 500,
|
|
19
|
-
'Represents the required file size in
|
|
19
|
+
'Represents the required file size in bytes. Not relevant if random calculation is triggered')
|
|
20
20
|
Params.integer('total_created_directories', -1,
|
|
21
21
|
'Represents the total created directories. Use any negative value or zero for Infinity.
|
|
22
22
|
Not relevant if random calculation is triggered')
|
|
@@ -237,7 +237,7 @@ module FileUtils
|
|
|
237
237
|
|
|
238
238
|
not_found = {}
|
|
239
239
|
not_found_cd = ContentData::ContentData.new
|
|
240
|
-
warnings =
|
|
240
|
+
warnings = ""
|
|
241
241
|
dest.chop! if (dest.end_with?("/") or dest.end_with?("\\"))
|
|
242
242
|
|
|
243
243
|
ref_cd.each_instance { |checksum, size, content_mod_time, inst_mod_time, server, path|
|
|
@@ -248,7 +248,7 @@ module FileUtils
|
|
|
248
248
|
else
|
|
249
249
|
# add instance to not_found cd
|
|
250
250
|
not_found_cd.add_instance(checksum, size, server, path, inst_mod_time)
|
|
251
|
-
warnings << "Warning: base content does not contains:'%s'" % checksum
|
|
251
|
+
warnings << "Warning: base content does not contains:'%s'\n" % checksum
|
|
252
252
|
end
|
|
253
253
|
}
|
|
254
254
|
Log.warning (warnings)
|
data/lib/file_utils/version.rb
CHANGED
data/lib/log/version.rb
CHANGED
data/lib/networking/version.rb
CHANGED
data/lib/params/version.rb
CHANGED
|
@@ -150,7 +150,7 @@ module TestingMemory
|
|
|
150
150
|
dir_count = ObjectSpace.each_object(FileMonitoring::DirStat).count
|
|
151
151
|
current_objects_counters['DirStat'] = dir_count
|
|
152
152
|
file_count = ObjectSpace.each_object(FileMonitoring::FileStat).count
|
|
153
|
-
current_objects_counters['FileStat'] = file_count
|
|
153
|
+
current_objects_counters['FileStat'] = file_count
|
|
154
154
|
|
|
155
155
|
# Generate report and update global counters
|
|
156
156
|
report = ""
|
|
@@ -199,7 +199,7 @@ module TestingServer
|
|
|
199
199
|
dir_count = ObjectSpace.each_object(FileMonitoring::DirStat).count
|
|
200
200
|
current_objects_counters['DirStat'] = dir_count
|
|
201
201
|
file_count = ObjectSpace.each_object(FileMonitoring::FileStat).count
|
|
202
|
-
current_objects_counters['FileStat'] = file_count
|
|
202
|
+
current_objects_counters['FileStat'] = file_count
|
|
203
203
|
|
|
204
204
|
# Generate report and update global counters
|
|
205
205
|
report = ""
|
|
@@ -104,8 +104,8 @@ module ContentData
|
|
|
104
104
|
failed.content_exists(@checksum2).should be_true
|
|
105
105
|
failed.checksum_instances_size(absent_checksum).should eq(1)
|
|
106
106
|
failed.checksum_instances_size(@checksum2).should eq(1)
|
|
107
|
-
failed.instance_exists(absent_path, @server
|
|
108
|
-
failed.instance_exists(@path2, @server
|
|
107
|
+
failed.instance_exists(absent_path, @server).should be_true
|
|
108
|
+
failed.instance_exists(@path2, @server).should be_true
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
111
|
end
|
|
@@ -2,6 +2,7 @@ require 'log'
|
|
|
2
2
|
require 'rspec'
|
|
3
3
|
require 'stringio'
|
|
4
4
|
|
|
5
|
+
require_relative '../../lib/content_server/backup_server'
|
|
5
6
|
require_relative '../../lib/content_server/file_streamer'
|
|
6
7
|
|
|
7
8
|
# Uncomment to debug spec.
|
|
@@ -10,7 +11,11 @@ Params['log_write_to_file'] = false
|
|
|
10
11
|
Params['log_debug_level'] = 0
|
|
11
12
|
Params['streaming_chunk_size'] = 5
|
|
12
13
|
Params.init ARGV
|
|
14
|
+
Params['log_write_to_file'] = false
|
|
15
|
+
Params['log_write_to_console'] = false
|
|
16
|
+
Params['enable_monitoring'] = false
|
|
13
17
|
Log.init
|
|
18
|
+
ContentServer.init_globals
|
|
14
19
|
# Have to be set to test chunking mechanism.
|
|
15
20
|
|
|
16
21
|
module ContentServer
|
data/spec/networking/tcp_spec.rb
CHANGED
|
@@ -5,9 +5,6 @@ require 'stringio'
|
|
|
5
5
|
|
|
6
6
|
require_relative '../../lib/networking/tcp'
|
|
7
7
|
|
|
8
|
-
# Uncomment to debug spec.
|
|
9
|
-
Params['log_write_to_console'] = true
|
|
10
|
-
Params['log_debug_level'] = 0
|
|
11
8
|
Log.init
|
|
12
9
|
|
|
13
10
|
module Networking
|
|
@@ -31,6 +28,7 @@ module Networking
|
|
|
31
28
|
info = 'info'
|
|
32
29
|
data = 'kuku!!!'
|
|
33
30
|
stream = StringIO.new
|
|
31
|
+
stream.stub(:peeraddr).and_return(Array.new)
|
|
34
32
|
::Socket.stub(:tcp_server_loop).and_yield(stream, info)
|
|
35
33
|
::TCPSocket.stub(:new).and_return(stream)
|
|
36
34
|
|
|
@@ -67,8 +67,8 @@ module Validations
|
|
|
67
67
|
failed.content_exists(@checksum2).should be_true
|
|
68
68
|
failed.checksum_instances_size(absent_checksum).should eq(1)
|
|
69
69
|
failed.checksum_instances_size(@checksum2).should eq(1)
|
|
70
|
-
failed.instance_exists(absent_path, @server
|
|
71
|
-
failed.instance_exists(@path4, @server
|
|
70
|
+
failed.instance_exists(absent_path, @server).should be_true
|
|
71
|
+
failed.instance_exists(@path4, @server).should be_true
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
end
|
|
@@ -5,9 +5,12 @@ require_relative '../../lib/content_data/content_data.rb'
|
|
|
5
5
|
|
|
6
6
|
class TestContentData < Test::Unit::TestCase
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
def setup
|
|
9
|
+
Params.init Array.new
|
|
10
|
+
# must preced Log.init, otherwise log containing default values will be created
|
|
11
|
+
Params['log_write_to_file'] = false
|
|
12
|
+
Log.init
|
|
13
|
+
end
|
|
11
14
|
|
|
12
15
|
def test_cloning_db_1
|
|
13
16
|
content_data = ContentData::ContentData.new
|
|
@@ -56,17 +59,15 @@ class TestContentData < Test::Unit::TestCase
|
|
|
56
59
|
#both new content and new instances are created in DB
|
|
57
60
|
content_data.add_instance("A2", 60, "server_1",
|
|
58
61
|
"/home/file_2", 3333333333)
|
|
59
|
-
assert_equal("2\nA1,60,2222222222\nA2,60,3333333333\
|
|
62
|
+
assert_equal("2\nA1,60,2222222222\nA2,60,3333333333\n2\n" +
|
|
60
63
|
"A1,60,server_1,/home/file_1,2222222222\n" +
|
|
61
|
-
"A1,60,server_1,/home/file_2,2222222222\n" +
|
|
62
64
|
"A2,60,server_1,/home/file_2,3333333333\n", content_data.to_s)
|
|
63
65
|
|
|
64
66
|
#Add new instance - same content
|
|
65
67
|
content_data.add_instance("A2", 60, "server_1",
|
|
66
68
|
"/home/file_3", 4444444444)
|
|
67
|
-
assert_equal("2\nA1,60,2222222222\nA2,60,3333333333\
|
|
69
|
+
assert_equal("2\nA1,60,2222222222\nA2,60,3333333333\n3\n" +
|
|
68
70
|
"A1,60,server_1,/home/file_1,2222222222\n" +
|
|
69
|
-
"A1,60,server_1,/home/file_2,2222222222\n" +
|
|
70
71
|
"A2,60,server_1,/home/file_2,3333333333\n" +
|
|
71
72
|
"A2,60,server_1,/home/file_3,4444444444\n", content_data.to_s)
|
|
72
73
|
end
|
|
@@ -15,6 +15,7 @@ module FileGenerator
|
|
|
15
15
|
Params['sleep_time_in_seconds'] = 0
|
|
16
16
|
Params['dir_name_prefix'] = "td4bs"
|
|
17
17
|
Params['file_name_prefix'] = "agf4bs_"
|
|
18
|
+
Params['file_size_in_bytes'] = 10
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
it 'should reach File.open 1 files' do
|
|
@@ -73,9 +74,9 @@ module FileGenerator
|
|
|
73
74
|
|
|
74
75
|
it 'should create filename and put text in it' do
|
|
75
76
|
file = mock('file')
|
|
76
|
-
File.should_receive(:open).with(any_args(), "w").exactly(2).times.and_yield(file)
|
|
77
|
-
file.should_receive(:write).exactly(2).times
|
|
78
77
|
Params['total_files_in_dir'] = 2
|
|
78
|
+
File.should_receive(:open).with(any_args(), "w").exactly(Params['total_files_in_dir']).times.and_yield(file)
|
|
79
|
+
file.should_receive(:write).exactly(Params['file_size_in_bytes'] * Params['total_files_in_dir']).times
|
|
79
80
|
fg = FileGenerator.new()
|
|
80
81
|
fg.run()
|
|
81
82
|
end
|
|
@@ -13,6 +13,34 @@ module FileMonitoring
|
|
|
13
13
|
MOVE_DEST_DIR = RESOURCES_DIR # directory where moved entities will be placed
|
|
14
14
|
LOG_PATH = RESOURCES_DIR + '/../log.txt'
|
|
15
15
|
|
|
16
|
+
# simulates log4r activuty used by FileMonitoring
|
|
17
|
+
class LogMock
|
|
18
|
+
def initialize()
|
|
19
|
+
File.unlink(LOG_PATH) if File.exists?(LOG_PATH)
|
|
20
|
+
@log = File.open(LOG_PATH, 'w+')
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def close()
|
|
24
|
+
@log.close()
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def outputters()
|
|
28
|
+
[self];
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def flush()
|
|
32
|
+
# Do nothing
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def log()
|
|
36
|
+
@log
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def info(str)
|
|
40
|
+
@log.puts(str)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
16
44
|
def setup
|
|
17
45
|
@sizes = [500, 1000, 1500]
|
|
18
46
|
@numb_of_copies = 2
|
|
@@ -48,11 +76,19 @@ module FileMonitoring
|
|
|
48
76
|
::FileUtils.cp(file_path, "#{file_path}.#{i}")
|
|
49
77
|
end
|
|
50
78
|
end
|
|
79
|
+
|
|
80
|
+
@log4r_mock = LogMock.new
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def teardown()
|
|
84
|
+
@log4r_mock.close
|
|
85
|
+
File.unlink(LOG_PATH)
|
|
86
|
+
::FileUtils.rm_rf(RESOURCES_DIR) if (File.exists?(RESOURCES_DIR))
|
|
51
87
|
end
|
|
52
88
|
|
|
53
89
|
def test_monitor
|
|
54
|
-
log =
|
|
55
|
-
FileStat.set_log(
|
|
90
|
+
log = @log4r_mock.log
|
|
91
|
+
FileStat.set_log(@log4r_mock)
|
|
56
92
|
test_dir = DirStat.new(RESOURCES_DIR)
|
|
57
93
|
|
|
58
94
|
# Initial run of monitoring -> initializing DirStat object
|
|
@@ -145,8 +181,6 @@ module FileMonitoring
|
|
|
145
181
|
assert_equal(true, line.include?(FileStatEnum::STABLE))
|
|
146
182
|
end
|
|
147
183
|
assert_equal(@numb_entities, log.lineno - log_prev_line)
|
|
148
|
-
|
|
149
|
-
log.close
|
|
150
184
|
end
|
|
151
185
|
end
|
|
152
186
|
end
|
|
@@ -18,6 +18,11 @@ module FileUtils
|
|
|
18
18
|
@base_db
|
|
19
19
|
|
|
20
20
|
def setup
|
|
21
|
+
Params.init Array.new
|
|
22
|
+
# must preced Log.init, otherwise log containing default values will be created
|
|
23
|
+
Params['log_write_to_file'] = false
|
|
24
|
+
Log.init
|
|
25
|
+
|
|
21
26
|
sizes = [500, 1000, 1500]
|
|
22
27
|
numb_of_copies = 2
|
|
23
28
|
test_file_name = "test_file" # file name format: <test_file_name_prefix>.<size>[.serial_number_if_more_then_1]
|
|
@@ -78,6 +83,10 @@ module FileUtils
|
|
|
78
83
|
@ref_db.add_instance(NOT_FOUND_CHECKSUM, 500, `hostname`.chomp, "/not/exist/path/file", Time.now.utc.to_i)
|
|
79
84
|
end
|
|
80
85
|
|
|
86
|
+
def teardown
|
|
87
|
+
::FileUtils.rm_rf(RESOURCES_DIR) if (File.exists?(RESOURCES_DIR))
|
|
88
|
+
end
|
|
89
|
+
|
|
81
90
|
def test_create_symlink_structure
|
|
82
91
|
not_found_db = nil
|
|
83
92
|
begin
|
|
@@ -32,6 +32,12 @@ module FileUtils
|
|
|
32
32
|
@mod_instance_checksum = nil # checksum of the instance that was manually modified
|
|
33
33
|
|
|
34
34
|
def setup
|
|
35
|
+
Params.init Array.new
|
|
36
|
+
# must preced Log.init, otherwise log containing default values will be created
|
|
37
|
+
Params['log_write_to_file'] = false
|
|
38
|
+
Params['log_write_to_console'] = false
|
|
39
|
+
Log.init
|
|
40
|
+
|
|
35
41
|
sizes = [500, 1000, 1500]
|
|
36
42
|
numb_of_copies = 2
|
|
37
43
|
test_file_name = "test_file"
|
|
@@ -121,8 +127,6 @@ module FileUtils
|
|
|
121
127
|
patterns = FileIndexing::IndexerPatterns.new
|
|
122
128
|
patterns.add_pattern(File.dirname(path) + '/*') # this pattern index all files
|
|
123
129
|
indexer.index(patterns, mod_db)
|
|
124
|
-
p mod_db.to_s
|
|
125
|
-
p indexer.indexed_content.to_s
|
|
126
130
|
assert_equal(indexer.indexed_content, mod_db)
|
|
127
131
|
break
|
|
128
132
|
}
|
|
@@ -6,22 +6,24 @@
|
|
|
6
6
|
DBG = false # NOTE be sure to disable it in production
|
|
7
7
|
|
|
8
8
|
begin
|
|
9
|
-
begin
|
|
10
|
-
require 'log'
|
|
11
|
-
require 'params'
|
|
12
|
-
rescue LoadError
|
|
13
|
-
$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'lib'))
|
|
14
|
-
$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), '..', '..'))
|
|
15
|
-
require 'log'
|
|
16
|
-
require 'params'
|
|
17
|
-
end
|
|
18
9
|
|
|
19
10
|
# On WindowsXP log can be found under:
|
|
20
11
|
# C:/Documents and Settings/NetworkService/.bbfs/test_app_<pid>.log
|
|
21
|
-
Params['log_file_name'] = File.join(Dir.home, '.bbfs', "#{File.basename(__FILE__)}_#{Process.pid}.log")
|
|
22
|
-
Params['log_write_to_console'] = false
|
|
12
|
+
#Params['log_file_name'] = File.join(Dir.home, '.bbfs', "#{File.basename(__FILE__)}_#{Process.pid}.log")
|
|
23
13
|
if DBG
|
|
14
|
+
begin
|
|
15
|
+
require 'params'
|
|
16
|
+
require 'log'
|
|
17
|
+
rescue LoadError
|
|
18
|
+
$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'lib'))
|
|
19
|
+
$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), '..', '..'))
|
|
20
|
+
require 'params'
|
|
21
|
+
require 'log'
|
|
22
|
+
end
|
|
23
|
+
Params.init Array.new
|
|
24
24
|
Params['log_debug_level'] = 1
|
|
25
|
+
Params['log_write_to_console'] = false
|
|
26
|
+
Params['log_write_to_file'] = true
|
|
25
27
|
Log.init
|
|
26
28
|
end
|
|
27
29
|
|
|
@@ -35,23 +37,23 @@ begin
|
|
|
35
37
|
require 'run_in_background'
|
|
36
38
|
end
|
|
37
39
|
|
|
38
|
-
Log.debug1 "Before run in background: PID #{Process.pid}"
|
|
40
|
+
Log.debug1 "Before run in background: PID #{Process.pid}" if DBG
|
|
39
41
|
# ARGV.pop returns frozen string and thus causes a failure of Service.create
|
|
40
42
|
# to fix it new string with the same content created.
|
|
41
43
|
RunInBackground.start!(String.new(ARGV.pop))
|
|
42
44
|
# if got here then error
|
|
43
|
-
Log.error "After run in background: ERROR"
|
|
45
|
+
Log.error "After run in background: ERROR" if DBG
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
max = (ARGV.size > 0 && ARGV[0] != nil && ARGV[0].to_i > 0)? ARGV[0].to_i : 200
|
|
47
49
|
|
|
48
50
|
while max > 0
|
|
49
|
-
Log.debug1 "#{max}"
|
|
51
|
+
Log.debug1 "#{max}" if DBG
|
|
50
52
|
sleep 1
|
|
51
53
|
max -= 1
|
|
52
54
|
end
|
|
53
55
|
|
|
54
56
|
rescue Exception => err
|
|
55
|
-
Log.error "Wrapper error: #{err}"
|
|
57
|
+
Log.error "Wrapper error: #{err}" if DBG
|
|
56
58
|
raise
|
|
57
59
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: content_server
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -258,7 +258,6 @@ files:
|
|
|
258
258
|
- lib/content_server/remote_content.rb
|
|
259
259
|
- lib/content_server/version.rb
|
|
260
260
|
- lib/content_server/backup_server.rb
|
|
261
|
-
- lib/content_server/queue_indexer.rb
|
|
262
261
|
- lib/email.rb
|
|
263
262
|
- lib/email/email.rb
|
|
264
263
|
- lib/email/version.rb
|
|
@@ -302,50 +301,6 @@ files:
|
|
|
302
301
|
- lib/validations/version.rb
|
|
303
302
|
- test/content_data/content_data_test.rb
|
|
304
303
|
- test/file_generator/file_generator_spec.rb
|
|
305
|
-
- test/file_indexing/index_agent_test.rb
|
|
306
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libxslt.dll
|
|
307
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/xsltproc.exe
|
|
308
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libexslt.dll
|
|
309
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/readme.txt
|
|
310
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt_a.lib
|
|
311
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt.lib
|
|
312
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt_a.lib
|
|
313
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt.lib
|
|
314
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/libexslt.h
|
|
315
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltexports.h
|
|
316
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exslt.h
|
|
317
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltconfig.h
|
|
318
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltwin32config.h
|
|
319
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltexports.h
|
|
320
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/win32config.h
|
|
321
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltconfig.h
|
|
322
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xslt.h
|
|
323
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/functions.h
|
|
324
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/attributes.h
|
|
325
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/security.h
|
|
326
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/templates.h
|
|
327
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltutils.h
|
|
328
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/variables.h
|
|
329
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extra.h
|
|
330
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/pattern.h
|
|
331
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/documents.h
|
|
332
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/trio.h
|
|
333
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/preproc.h
|
|
334
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltInternals.h
|
|
335
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/imports.h
|
|
336
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extensions.h
|
|
337
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/libxslt.h
|
|
338
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltlocale.h
|
|
339
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/namespaces.h
|
|
340
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/keys.h
|
|
341
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/transform.h
|
|
342
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/numbersInternals.h
|
|
343
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/triodef.h
|
|
344
|
-
- test/file_indexing/index_agent_test/New.txt
|
|
345
|
-
- test/file_indexing/index_agent_test/patterns.input
|
|
346
|
-
- test/file_monitoring/file_monitoring_test/conf.yml
|
|
347
|
-
- test/file_monitoring/file_monitoring_test/log
|
|
348
|
-
- test/file_monitoring/file_monitoring_test/conf_win32.yml
|
|
349
304
|
- test/file_monitoring/monitor_path_test/test_file.500.0
|
|
350
305
|
- test/file_monitoring/monitor_path_test/dir1000/test_file.1000.1
|
|
351
306
|
- test/file_monitoring/monitor_path_test/dir1000/test_file.1000.0
|
|
@@ -355,7 +310,6 @@ files:
|
|
|
355
310
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500
|
|
356
311
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500.0
|
|
357
312
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500.1
|
|
358
|
-
- test/file_monitoring/file_monitoring_test.rb
|
|
359
313
|
- test/file_monitoring/monitor_path_test.rb
|
|
360
314
|
- test/file_utils/fileutil_mksymlink_test/test_file.500.0
|
|
361
315
|
- test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.1
|
|
@@ -411,50 +365,6 @@ summary: Servers for backing up content.
|
|
|
411
365
|
test_files:
|
|
412
366
|
- test/content_data/content_data_test.rb
|
|
413
367
|
- test/file_generator/file_generator_spec.rb
|
|
414
|
-
- test/file_indexing/index_agent_test.rb
|
|
415
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libxslt.dll
|
|
416
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/xsltproc.exe
|
|
417
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libexslt.dll
|
|
418
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/readme.txt
|
|
419
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt_a.lib
|
|
420
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt.lib
|
|
421
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt_a.lib
|
|
422
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt.lib
|
|
423
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/libexslt.h
|
|
424
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltexports.h
|
|
425
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exslt.h
|
|
426
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltconfig.h
|
|
427
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltwin32config.h
|
|
428
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltexports.h
|
|
429
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/win32config.h
|
|
430
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltconfig.h
|
|
431
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xslt.h
|
|
432
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/functions.h
|
|
433
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/attributes.h
|
|
434
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/security.h
|
|
435
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/templates.h
|
|
436
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltutils.h
|
|
437
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/variables.h
|
|
438
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extra.h
|
|
439
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/pattern.h
|
|
440
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/documents.h
|
|
441
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/trio.h
|
|
442
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/preproc.h
|
|
443
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltInternals.h
|
|
444
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/imports.h
|
|
445
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extensions.h
|
|
446
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/libxslt.h
|
|
447
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltlocale.h
|
|
448
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/namespaces.h
|
|
449
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/keys.h
|
|
450
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/transform.h
|
|
451
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/numbersInternals.h
|
|
452
|
-
- test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/triodef.h
|
|
453
|
-
- test/file_indexing/index_agent_test/New.txt
|
|
454
|
-
- test/file_indexing/index_agent_test/patterns.input
|
|
455
|
-
- test/file_monitoring/file_monitoring_test/conf.yml
|
|
456
|
-
- test/file_monitoring/file_monitoring_test/log
|
|
457
|
-
- test/file_monitoring/file_monitoring_test/conf_win32.yml
|
|
458
368
|
- test/file_monitoring/monitor_path_test/test_file.500.0
|
|
459
369
|
- test/file_monitoring/monitor_path_test/dir1000/test_file.1000.1
|
|
460
370
|
- test/file_monitoring/monitor_path_test/dir1000/test_file.1000.0
|
|
@@ -464,7 +374,6 @@ test_files:
|
|
|
464
374
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500
|
|
465
375
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500.0
|
|
466
376
|
- test/file_monitoring/monitor_path_test/dir1500/test_file.1500.1
|
|
467
|
-
- test/file_monitoring/file_monitoring_test.rb
|
|
468
377
|
- test/file_monitoring/monitor_path_test.rb
|
|
469
378
|
- test/file_utils/fileutil_mksymlink_test/test_file.500.0
|
|
470
379
|
- test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.1
|