-
Notifications
You must be signed in to change notification settings - Fork 8.4k
twister: add instance name as default parameter #81389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1315,6 +1315,38 @@ Using Single Board For Multiple Variants | |
| runner: nrfjprog | ||
| serial: /dev/ttyACM1 | ||
|
|
||
| Scripts Usage for platform | ||
| ++++++++++++++++++++++++++ | ||
|
|
||
| Below scripts are supported | ||
|
|
||
| * pre_script: <path to pre script> | ||
|
|
||
| * post_script: <path to pre script> | ||
|
|
||
| * post_flash_script: <path to pre script> | ||
|
|
||
| each of above scripts can have timeout defined as below in hardwar map file by script_param | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| - connected: false | ||
| id: 0229000005d9ebc600000000000000000000000097969905 | ||
| platform: mimxrt1060_evk | ||
| probe_id: 000609301751 | ||
| product: DAPLink CMSIS-DAP | ||
| runner: jlink | ||
| serial: null | ||
| pre_script: pre_scripts.sh | ||
| post_script: post_scripts.sh | ||
| post_flash_script: post_flash_scripts.sh | ||
| script_param: | ||
| "pre_script_timeout": 100 | ||
| "post_script_timeout": 100 | ||
| "post_flash_timeout": 100 | ||
|
|
||
| also a default patameter <testinstance.name> will be pass as fist parameter for scripts | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hakehuang, to be on the same page: why you need the instance name to pass to scripts ? btw. it is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have a platform, for security reasons, it need pre-load different security blobs to board first, before run test. @golowanow .
it is not an issue at my case, as per_script is always defined in platform level, so we know which platform it is running already. and suite_path is not need usually, as pre_script does not always go with the build but run
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
so in your use case the parameter it is just for well, I think it is a quite frequent situation when the same flash- script is re-used with different platforms/variants (currently that can be solved creating links to the same script file with different names), and the better and general solution would be to call these scripts with a basic set of expected parameters (like what Twister has
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the platform information is already contained in the map.yaml, which pre/post scripts rely on. and this could be fixed to the only interface. |
||
|
|
||
| Quarantine | ||
| ++++++++++ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -714,7 +714,10 @@ def handle(self, harness): | |
| timeout = 30 | ||
| if script_param: | ||
| timeout = script_param.get("pre_script_timeout", timeout) | ||
| self.run_custom_script(pre_script, timeout) | ||
| pre_script_cmd = ([pre_script] + | ||
|
||
| [self.instance.name] | ||
| ) | ||
| self.run_custom_script(pre_script_cmd, timeout) | ||
|
|
||
| flash_timeout = hardware.flash_timeout | ||
| if hardware.flash_with_test: | ||
|
|
@@ -782,7 +785,10 @@ def handle(self, harness): | |
| timeout = 30 | ||
| if script_param: | ||
| timeout = script_param.get("post_flash_timeout", timeout) | ||
| self.run_custom_script(post_flash_script, timeout) | ||
| post_flash_script_cmd = ([post_flash_script] + | ||
| [self.instance.name] | ||
| ) | ||
| self.run_custom_script(post_flash_script_cmd, timeout) | ||
|
|
||
| # Connect to device after flashing it | ||
| if hardware.flash_before: | ||
|
|
@@ -824,7 +830,10 @@ def handle(self, harness): | |
| timeout = 30 | ||
| if script_param: | ||
| timeout = script_param.get("post_script_timeout", timeout) | ||
| self.run_custom_script(post_script, timeout) | ||
| post_script_cmd = ([post_script] + | ||
| [self.instance.name] | ||
| ) | ||
| self.run_custom_script(post_script_cmd, timeout) | ||
|
|
||
| self.make_dut_available(hardware) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardware map