cutedriver-driver 2.0.0.20210120164037
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.
- checksums.yaml +7 -0
- data/README.md +16 -0
- data/bin/start_app_perf +200 -0
- data/bin/tdriver-devtools +3 -0
- data/config/sut_parameters.rb +52 -0
- data/config/sut_setup.rb +32 -0
- data/config/sut_teardown.rb +32 -0
- data/config/tdriver_custom_error_recovery.rb +83 -0
- data/ext/extconf.rb +70 -0
- data/ext/native_extensions.c +315 -0
- data/lib/matti.rb +25 -0
- data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +120 -0
- data/lib/tdriver-devtools/behaviour/old/xml/example/impl.rb_invalid +194 -0
- data/lib/tdriver-devtools/behaviour/old/xml/generate_behaviour_xml.rb +95 -0
- data/lib/tdriver-devtools/behaviour/old/xml/lib/tdriver_generator.rb +722 -0
- data/lib/tdriver-devtools/behaviour/old/xml/qdoc_generator.rb +321 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.method.template +43 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.module.template +54 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument.template +7 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument_type.template +7 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.exception.template +5 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.line.template +2 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.template +5 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.method.template +23 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.template +14 -0
- data/lib/tdriver-devtools/behaviour/old/xml/update +3 -0
- data/lib/tdriver-devtools/behaviour/xml/generate.rb +88 -0
- data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +1945 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.default.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument_type.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.exception.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.arguments.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.deprecated.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.exceptions.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.info.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.returns.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.tables.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.template +12 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.returns.template +5 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.item.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.row.template +2 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.template +8 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.template +14 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/QtExampleGestureBehaviour.xml +138 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/created.rid +1 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/tdriver.hash +1 -0
- data/lib/tdriver-devtools/doc/feature_xml/qt_widget_hold.feature.xml +9 -0
- data/lib/tdriver-devtools/doc/feature_xml/qt_widget_tap.feature.xml +9 -0
- data/lib/tdriver-devtools/doc/generate.rb +917 -0
- data/lib/tdriver-devtools/doc/update +1 -0
- data/lib/tdriver-devtools/doc/xslt/html.rb +7 -0
- data/lib/tdriver-devtools/doc/xslt/template.xsl +2170 -0
- data/lib/tdriver-devtools/doc/xslt/update +3 -0
- data/lib/tdriver-devtools/plugin/placeholder.txt +1 -0
- data/lib/tdriver-devtools/tdriver-devtools.rb +404 -0
- data/lib/tdriver-devtools/tests/feature_tests/example/behaviour_example.rb +100 -0
- data/lib/tdriver-devtools/tests/feature_tests/generate.rb +82 -0
- data/lib/tdriver-devtools/tests/feature_tests/lib/custom_rdoc_generator.rb +468 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/feature_attribute.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/feature_method.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_attribute.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_method.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/update +3 -0
- data/lib/tdriver.rb +23 -0
- data/lib/tdriver/base/behaviour/abstract.rb +29 -0
- data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +99 -0
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +278 -0
- data/lib/tdriver/base/behaviour/behaviours/object_composition.rb +119 -0
- data/lib/tdriver/base/behaviour/factory.rb +495 -0
- data/lib/tdriver/base/behaviour/loader.rb +46 -0
- data/lib/tdriver/base/command_data/command_data.rb +51 -0
- data/lib/tdriver/base/command_data/loader.rb +29 -0
- data/lib/tdriver/base/controller/abstraction.rb +56 -0
- data/lib/tdriver/base/controller/loader.rb +21 -0
- data/lib/tdriver/base/errors.rb +134 -0
- data/lib/tdriver/base/loader.rb +47 -0
- data/lib/tdriver/base/state_object.rb +373 -0
- data/lib/tdriver/base/sut/adapter.rb +54 -0
- data/lib/tdriver/base/sut/controller.rb +151 -0
- data/lib/tdriver/base/sut/factory.rb +339 -0
- data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
- data/lib/tdriver/base/sut/generic/behaviours/application.rb +427 -0
- data/lib/tdriver/base/sut/generic/behaviours/controller.rb +67 -0
- data/lib/tdriver/base/sut/generic/behaviours/find.rb +107 -0
- data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +337 -0
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +1888 -0
- data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +210 -0
- data/lib/tdriver/base/sut/generic/behaviours/verification.rb +222 -0
- data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
- data/lib/tdriver/base/sut/generic/commands/application.rb +274 -0
- data/lib/tdriver/base/sut/generic/commands/fixture.rb +47 -0
- data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +94 -0
- data/lib/tdriver/base/sut/generic/commands/screen_capture.rb +64 -0
- data/lib/tdriver/base/sut/generic/plugin.rb +97 -0
- data/lib/tdriver/base/sut/loader.rb +35 -0
- data/lib/tdriver/base/sut/sut.rb +98 -0
- data/lib/tdriver/base/test_object/abstract.rb +208 -0
- data/lib/tdriver/base/test_object/adapter.rb +740 -0
- data/lib/tdriver/base/test_object/behaviours/syncronization.rb +144 -0
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +1047 -0
- data/lib/tdriver/base/test_object/cache.rb +134 -0
- data/lib/tdriver/base/test_object/factory.rb +684 -0
- data/lib/tdriver/base/test_object/loader.rb +51 -0
- data/lib/tdriver/base/test_object/verification.rb +178 -0
- data/lib/tdriver/base/test_object/xml/abstraction.rb +63 -0
- data/lib/tdriver/base/test_object/xml/adapter.rb +773 -0
- data/lib/tdriver/env.rb +21 -0
- data/lib/tdriver/loader.rb +57 -0
- data/lib/tdriver/matti.rb +35 -0
- data/lib/tdriver/report/error_recovery/tdriver_custom_error_recovery.rb +83 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +168 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +106 -0
- data/lib/tdriver/report/report.rb +61 -0
- data/lib/tdriver/report/report_api.rb +348 -0
- data/lib/tdriver/report/report_combine.rb +86 -0
- data/lib/tdriver/report/report_crash_file_capture.rb +178 -0
- data/lib/tdriver/report/report_creator.rb +665 -0
- data/lib/tdriver/report/report_cucumber.rb +158 -0
- data/lib/tdriver/report/report_cucumber_listener.rb +184 -0
- data/lib/tdriver/report/report_cucumber_reporter.rb +181 -0
- data/lib/tdriver/report/report_data_presentation.rb +156 -0
- data/lib/tdriver/report/report_data_table.rb +64 -0
- data/lib/tdriver/report/report_execution_statistics.rb +400 -0
- data/lib/tdriver/report/report_file_capture.rb +159 -0
- data/lib/tdriver/report/report_graph_generator.rb +59 -0
- data/lib/tdriver/report/report_grouping.rb +541 -0
- data/lib/tdriver/report/report_javascript.rb +199 -0
- data/lib/tdriver/report/report_junit_xml.rb +147 -0
- data/lib/tdriver/report/report_rspec.rb +108 -0
- data/lib/tdriver/report/report_test_case_run.rb +725 -0
- data/lib/tdriver/report/report_test_run.rb +1476 -0
- data/lib/tdriver/report/report_test_unit.rb +223 -0
- data/lib/tdriver/report/report_writer.rb +1621 -0
- data/lib/tdriver/tdriver.rb +209 -0
- data/lib/tdriver/util/agent/loader.rb +22 -0
- data/lib/tdriver/util/agent/service.rb +107 -0
- data/lib/tdriver/util/common/array.rb +39 -0
- data/lib/tdriver/util/common/boolean.rb +48 -0
- data/lib/tdriver/util/common/crc16.rb +149 -0
- data/lib/tdriver/util/common/environment.rb +154 -0
- data/lib/tdriver/util/common/error.rb +40 -0
- data/lib/tdriver/util/common/exception.rb +53 -0
- data/lib/tdriver/util/common/exceptions.rb +12 -0
- data/lib/tdriver/util/common/file.rb +328 -0
- data/lib/tdriver/util/common/gem.rb +109 -0
- data/lib/tdriver/util/common/hash.rb +288 -0
- data/lib/tdriver/util/common/kernel.rb +253 -0
- data/lib/tdriver/util/common/loader.rb +47 -0
- data/lib/tdriver/util/common/numeric.rb +159 -0
- data/lib/tdriver/util/common/object.rb +159 -0
- data/lib/tdriver/util/common/retryable.rb +179 -0
- data/lib/tdriver/util/common/stackable.rb +185 -0
- data/lib/tdriver/util/common/string.rb +174 -0
- data/lib/tdriver/util/database/access.rb +240 -0
- data/lib/tdriver/util/database/connection.rb +44 -0
- data/lib/tdriver/util/database/error.rb +34 -0
- data/lib/tdriver/util/database/loader.rb +28 -0
- data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
- data/lib/tdriver/util/filters/loader.rb +29 -0
- data/lib/tdriver/util/fixture/loader.rb +22 -0
- data/lib/tdriver/util/fixture/service.rb +211 -0
- data/lib/tdriver/util/hooking/hooking.rb +477 -0
- data/lib/tdriver/util/keymap/keymap.rb +81 -0
- data/lib/tdriver/util/loader.rb +80 -0
- data/lib/tdriver/util/localisation/error.rb +31 -0
- data/lib/tdriver/util/localisation/loader.rb +25 -0
- data/lib/tdriver/util/localisation/localisation.rb +762 -0
- data/lib/tdriver/util/logger/loader.rb +22 -0
- data/lib/tdriver/util/logger/logger.rb +591 -0
- data/lib/tdriver/util/operator_data/error.rb +29 -0
- data/lib/tdriver/util/operator_data/loader.rb +27 -0
- data/lib/tdriver/util/operator_data/operator_data.rb +93 -0
- data/lib/tdriver/util/other/config.rb +221 -0
- data/lib/tdriver/util/parameter/error.rb +48 -0
- data/lib/tdriver/util/parameter/loader.rb +25 -0
- data/lib/tdriver/util/parameter/parameter.rb +1161 -0
- data/lib/tdriver/util/plugin/abstract.rb +61 -0
- data/lib/tdriver/util/plugin/error.rb +0 -0
- data/lib/tdriver/util/plugin/loader.rb +28 -0
- data/lib/tdriver/util/plugin/service.rb +319 -0
- data/lib/tdriver/util/recorder/loader.rb +25 -0
- data/lib/tdriver/util/recorder/recorder.rb +72 -0
- data/lib/tdriver/util/recorder/scripter.rb +294 -0
- data/lib/tdriver/util/statistics/statistics.rb +89 -0
- data/lib/tdriver/util/user_data/error.rb +28 -0
- data/lib/tdriver/util/user_data/loader.rb +25 -0
- data/lib/tdriver/util/user_data/user_data.rb +104 -0
- data/lib/tdriver/util/video/camera.rb +67 -0
- data/lib/tdriver/util/video/camera_linux.rb +153 -0
- data/lib/tdriver/util/video/camera_windows.rb +174 -0
- data/lib/tdriver/util/video/loader.rb +31 -0
- data/lib/tdriver/util/video/video_utils.rb +139 -0
- data/lib/tdriver/util/xml/abstraction.rb +117 -0
- data/lib/tdriver/util/xml/attribute.rb +32 -0
- data/lib/tdriver/util/xml/builder.rb +53 -0
- data/lib/tdriver/util/xml/comment.rb +32 -0
- data/lib/tdriver/util/xml/document.rb +32 -0
- data/lib/tdriver/util/xml/element.rb +32 -0
- data/lib/tdriver/util/xml/error.rb +46 -0
- data/lib/tdriver/util/xml/loader.rb +62 -0
- data/lib/tdriver/util/xml/nil_node.rb +95 -0
- data/lib/tdriver/util/xml/nodeset.rb +32 -0
- data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +140 -0
- data/lib/tdriver/util/xml/parsers/loader.rb +21 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +167 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +66 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/builder.rb +64 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/comment.rb +39 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +66 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/element.rb +39 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/loader.rb +58 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +212 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +237 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/text.rb +39 -0
- data/lib/tdriver/util/xml/text.rb +32 -0
- data/lib/tdriver/util/xml/xml.rb +332 -0
- data/lib/tdriver/verify/verify.rb +2398 -0
- data/lib/tdriver/version.rb +21 -0
- data/xml/behaviours/generic.xml +530 -0
- data/xml/defaults/generic.xml +11 -0
- data/xml/defaults/sut_generic.xml +8 -0
- data/xml/parameters/tdriver_parameters.xml +23 -0
- data/xml/templates/generic.xml +292 -0
- metadata +324 -0
data/lib/tdriver/env.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
ENV['TDRIVER_PATH'] = File.expand_path( File.join( File.dirname( __FILE__ ), '..', '..' ) )
|
21
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
# load globally used external modules
|
21
|
+
require 'singleton'
|
22
|
+
|
23
|
+
#require 'set'
|
24
|
+
|
25
|
+
begin
|
26
|
+
|
27
|
+
# load native extensions if available
|
28
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'native_extensions' ) )
|
29
|
+
|
30
|
+
rescue LoadError
|
31
|
+
|
32
|
+
# do nothing
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# utility modules
|
37
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'util/loader.rb' ) )
|
38
|
+
|
39
|
+
# base modules
|
40
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'base/loader.rb' ) )
|
41
|
+
|
42
|
+
# verify module
|
43
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'verify/verify.rb' ) )
|
44
|
+
|
45
|
+
# reporting modules
|
46
|
+
if $parameters[ :enable_reporter, true ].true?
|
47
|
+
|
48
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'report/report.rb' ) )
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
# load report api for continuous verification reporting purposes
|
53
|
+
if $parameters[ :report_attach_continuous_verification_to_reporter, false ].true?
|
54
|
+
|
55
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'report/report_api' ) )
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'tdriver' ) )
|
21
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'loader' ) )
|
22
|
+
|
23
|
+
class MATTI
|
24
|
+
|
25
|
+
def self.method_missing( method_id, *args )
|
26
|
+
|
27
|
+
file, line = caller.first.split(":")
|
28
|
+
|
29
|
+
$stderr.puts "#{ file }:#{ line } warning: deprecated class #{ self.name }, use TDriver##{ method_id.to_s } instead"
|
30
|
+
|
31
|
+
TDriver.respond_to?( method_id ) ? TDriver.method( method_id ).call( *args ) : super
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
module TDriverCustomErrorRecovery
|
21
|
+
|
22
|
+
# This method is called by TDriver Reporter when error is detected in connection
|
23
|
+
# === params
|
24
|
+
# === returns
|
25
|
+
# === raises
|
26
|
+
def error_in_connection()
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# This method is called by TDriver Reporter when test set execution is starting
|
31
|
+
# === params
|
32
|
+
# === returns
|
33
|
+
# === raises
|
34
|
+
def starting_test_set_run()
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
# This method is called by TDriver Reporter when test case execution is starting
|
39
|
+
# === params
|
40
|
+
# test_case: the test case name
|
41
|
+
# connected_suts: All the connected TDriver suts
|
42
|
+
# === returns
|
43
|
+
# === raises
|
44
|
+
def starting_test_case(test_case,connected_suts)
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
# This method is called by TDriver Reporter when a error is detected in test case execution
|
49
|
+
# === params
|
50
|
+
# connected_suts: All the connected TDriver suts
|
51
|
+
# === returns
|
52
|
+
# === raises
|
53
|
+
def error_in_test_case(connected_suts)
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# This method is called by TDriver Reporter when test case details are updated
|
58
|
+
# === params
|
59
|
+
# details: Execution details recived from the current test case
|
60
|
+
# === returns
|
61
|
+
# === raises
|
62
|
+
def updating_test_case_details(details)
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
# This method is called by TDriver Reporter when test case execution is ended
|
67
|
+
# === params
|
68
|
+
# connected_suts: All the connected TDriver suts
|
69
|
+
# === returns
|
70
|
+
# === raises
|
71
|
+
def ending_test_case(status,connected_suts)
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
# This method is called by TDriver Reporter when test set execution is ending
|
76
|
+
# === params
|
77
|
+
# === returns
|
78
|
+
# === raises
|
79
|
+
def ending_test_set_run()
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
module TDriverErrorRecovery
|
22
|
+
|
23
|
+
# Initializes error recovery settings
|
24
|
+
# === params
|
25
|
+
# === returns
|
26
|
+
# === raises
|
27
|
+
def initialize_error_recovery
|
28
|
+
@recovery_settings=TDriverErrorRecoverySettings.new
|
29
|
+
if @recovery_settings.get_ats4_error_recovery_enabled=='true'
|
30
|
+
eval('module TDriver_Error_Recovery_ATS4
|
31
|
+
require \'dl/import\'
|
32
|
+
extend DL::Importable
|
33
|
+
dlload "callbackif"
|
34
|
+
extern "void restartDatagateway(const char*)"
|
35
|
+
extern "void restartHardware(const char*)"
|
36
|
+
extern "int getBootTimeout(const char*)"
|
37
|
+
extern "int error()"
|
38
|
+
end')
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
# Starts the error recovery for SUTs
|
44
|
+
# === params
|
45
|
+
# === returns
|
46
|
+
# === raises
|
47
|
+
def start_error_recovery()
|
48
|
+
resetted=false
|
49
|
+
initialize_error_recovery if @recovery_settings==nil
|
50
|
+
if @recovery_settings.get_error_recovery_enabled=='true'
|
51
|
+
MobyUtil::Logger.instance.log "behaviour" , "PASS;Starting error recovery"
|
52
|
+
if @recovery_settings.get_reconnect_device=='true'
|
53
|
+
if @recovery_settings.get_ping_connection=='true'
|
54
|
+
resetted=ping_devices_and_reconnect()
|
55
|
+
else
|
56
|
+
reconnect_devices()
|
57
|
+
resetted=true
|
58
|
+
end
|
59
|
+
end
|
60
|
+
MobyUtil::Logger.instance.log "behaviour" , "PASS;Error recovery complete"
|
61
|
+
end
|
62
|
+
resetted
|
63
|
+
end
|
64
|
+
|
65
|
+
# attempts a reconnect for the current SUT
|
66
|
+
# === params
|
67
|
+
# current_sut
|
68
|
+
# === returns
|
69
|
+
# === raises
|
70
|
+
def attempt_reconnect(current_sut)
|
71
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Connection lost attempting to reconnect"
|
72
|
+
attempt_reconnects=@recovery_settings.get_reconnect_attempts
|
73
|
+
current_reconnect_attempt=0
|
74
|
+
b_error_recovery_succesful=false
|
75
|
+
while current_reconnect_attempt.to_i<attempt_reconnects.to_i
|
76
|
+
if @recovery_settings.get_ats4_error_recovery_enabled=='true'
|
77
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;ATS4 Restarting Device #{current_sut.id}"
|
78
|
+
#TDriver_Error_Recovery_ATS4.restartDatagateway(current_sut.id.to_s);
|
79
|
+
current_sut.disconnect
|
80
|
+
TDriver_Error_Recovery_ATS4.restartHardware(current_sut.id.to_s);
|
81
|
+
ats_timeout=TDriver_Error_Recovery_ATS4.getBootTimeout(current_sut.id.to_s);
|
82
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Waiting for ATS4 error recovery #{ats_timeout}s"
|
83
|
+
if ats_timeout.to_i > 0
|
84
|
+
sleep ats_timeout.to_i
|
85
|
+
else
|
86
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Waiting ATS4 boot timeout is 0 using wait_time_for_ats4_error_recovery parameter timeout #{@recovery_settings.wait_time_for_ats4_error_recovery}s"
|
87
|
+
sleep @recovery_settings.wait_time_for_ats4_error_recovery.to_i
|
88
|
+
end
|
89
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;ATS4 Restarted Device #{current_sut.id}"
|
90
|
+
else
|
91
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Resetting sut: #{current_sut.id.to_s}"
|
92
|
+
current_sut.reset
|
93
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Sut resetted"
|
94
|
+
end
|
95
|
+
if ping_device(current_sut)==true
|
96
|
+
b_error_recovery_succesful=true
|
97
|
+
MobyUtil::Logger.instance.log "behaviour" , "PASS;Device reconnected"
|
98
|
+
current_reconnect_attempt=attempt_reconnects.to_i
|
99
|
+
else
|
100
|
+
current_reconnect_attempt+=1
|
101
|
+
end
|
102
|
+
end
|
103
|
+
raise MobyBase::BehaviourError.new("Error Recovery", "Error recovery failed after #{attempt_reconnects} recovery attempts") if b_error_recovery_succesful==false
|
104
|
+
end
|
105
|
+
|
106
|
+
# Reconnects the devices without ping
|
107
|
+
# === params
|
108
|
+
# === returns
|
109
|
+
# === raises
|
110
|
+
def reconnect_devices()
|
111
|
+
|
112
|
+
TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
|
113
|
+
suts=@recovery_settings.get_monitored_sut
|
114
|
+
suts.each do |monitored_sut|
|
115
|
+
if sut_id.to_s==monitored_sut.to_s
|
116
|
+
attempt_reconnect(sut_attributes[:sut])
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
# Ping the current SUT by querying xml state
|
124
|
+
# === params
|
125
|
+
# current sut
|
126
|
+
# === returns
|
127
|
+
# true for succesful ping
|
128
|
+
# false for failed ping
|
129
|
+
# === raises
|
130
|
+
def ping_device(current_sut)
|
131
|
+
begin
|
132
|
+
ui_xml=current_sut.get_ui_dump
|
133
|
+
if !ui_xml
|
134
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Device ping failed"
|
135
|
+
false
|
136
|
+
else
|
137
|
+
MobyUtil::Logger.instance.log "behaviour" , "PASS;Device ping succesful"
|
138
|
+
true
|
139
|
+
end
|
140
|
+
rescue Exception => e
|
141
|
+
puts e.message
|
142
|
+
puts e.backtrace
|
143
|
+
MobyUtil::Logger.instance.log "behaviour" , "WARNING;Device ping failed"
|
144
|
+
false
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Ping the devices and reconnect if ping fails
|
149
|
+
# === params
|
150
|
+
# === returns
|
151
|
+
# === raises
|
152
|
+
def ping_devices_and_reconnect()
|
153
|
+
resetted=false
|
154
|
+
TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes|
|
155
|
+
suts=@recovery_settings.get_monitored_sut
|
156
|
+
suts.each do |monitored_sut|
|
157
|
+
if sut_id.to_s==monitored_sut.to_s
|
158
|
+
if ping_device(sut_attributes[:sut])==false
|
159
|
+
resetted=true
|
160
|
+
attempt_reconnect(sut_attributes[:sut])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
resetted
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of Testability Driver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
class TDriverErrorRecoverySettings
|
25
|
+
def initialize
|
26
|
+
|
27
|
+
@error_recovery_enabled=nil
|
28
|
+
|
29
|
+
@ping_connection=nil
|
30
|
+
|
31
|
+
@ping_interval=nil
|
32
|
+
|
33
|
+
@reconnect_device=nil
|
34
|
+
|
35
|
+
@reconnect_attempts=nil
|
36
|
+
|
37
|
+
@monitored_suts=[]
|
38
|
+
|
39
|
+
@ats4_error_recovery_enabled=false
|
40
|
+
|
41
|
+
@wait_time_for_ats4_error_recovery=60
|
42
|
+
|
43
|
+
read_settings
|
44
|
+
end
|
45
|
+
# Read error recovery settings
|
46
|
+
# === params
|
47
|
+
# === returns
|
48
|
+
# === raises
|
49
|
+
def read_settings()
|
50
|
+
@error_recovery_enabled= $parameters[ :error_recovery_enabled ]
|
51
|
+
raise MobyBase::BehaviourError.new("error recovery", "error recovery enabled parameter not defined in tdriver_parameters.xml") if @error_recovery_enabled == nil
|
52
|
+
|
53
|
+
@ats4_error_recovery_enabled= $parameters[ :ats4_error_recovery_enabled ]
|
54
|
+
raise MobyBase::BehaviourError.new("error recovery", "ats4 error recovery enabled parameter not defined in tdriver_parameters.xml") if @ats4_error_recovery_enabled == nil
|
55
|
+
|
56
|
+
@wait_time_for_ats4_error_recovery= $parameters[ :wait_time_for_ats4_error_recovery ]
|
57
|
+
raise MobyBase::BehaviourError.new("error recovery", "ats4 error recovery wait time parameter not defined in tdriver_parameters.xml") if @wait_time_for_ats4_error_recovery == nil
|
58
|
+
|
59
|
+
@ping_connection= $parameters[ :ping_connection ]
|
60
|
+
raise MobyBase::BehaviourError.new("error recovery", "ping connection parameter not defined in tdriver_parameters.xml") if @ping_connection == nil
|
61
|
+
|
62
|
+
@reconnect_device= $parameters[ :reconnect_device ]
|
63
|
+
raise MobyBase::BehaviourError.new("error recovery", "reconnect device patameter not defined in tdriver_parameters.xml") if @reconnect_device == nil
|
64
|
+
|
65
|
+
@reconnect_attempts= $parameters[ :reconnect_attempts ]
|
66
|
+
raise MobyBase::BehaviourError.new("error recovery", "reconnect attempts patameter not defined in tdriver_parameters.xml") if @reconnect_attempts == nil
|
67
|
+
|
68
|
+
str_parameter= $parameters[ :error_recovery_monitored_sut_ids ]
|
69
|
+
raise MobyBase::BehaviourError.new("error recovery", "error_recovery_monitored_sut_ids patameter not defined in tdriver_parameters.xml") if str_parameter == nil
|
70
|
+
@monitored_suts=str_parameter.split('|')
|
71
|
+
|
72
|
+
|
73
|
+
end
|
74
|
+
def get_ats4_error_recovery_enabled
|
75
|
+
$parameters[ :ats4_error_recovery_enabled ]
|
76
|
+
end
|
77
|
+
def get_wait_time_for_ats4_error_recovery
|
78
|
+
$parameters[ :wait_time_for_ats4_error_recovery ]
|
79
|
+
end
|
80
|
+
def get_error_recovery_enabled
|
81
|
+
$parameters[ :error_recovery_enabled ]
|
82
|
+
end
|
83
|
+
def get_ping_connection
|
84
|
+
$parameters[ :ping_connection ]
|
85
|
+
end
|
86
|
+
def get_reconnect_device
|
87
|
+
$parameters[ :reconnect_device ]
|
88
|
+
end
|
89
|
+
def get_reconnect_attempts
|
90
|
+
$parameters[ :reconnect_attempts ]
|
91
|
+
end
|
92
|
+
def get_monitored_sut
|
93
|
+
str_parameter= $parameters[ :error_recovery_monitored_sut_ids ]
|
94
|
+
|
95
|
+
if str_parameter.include?('|')
|
96
|
+
@monitored_suts=str_parameter.split('|')
|
97
|
+
elsif str_parameter.include?(',')
|
98
|
+
@monitored_suts=str_parameter.split(',')
|
99
|
+
else
|
100
|
+
@monitored_suts=str_parameter
|
101
|
+
end
|
102
|
+
|
103
|
+
@monitored_suts
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|