naming test script 'run.sh' overwrites the script that runs the test

Bug #1213926 reported by Milosz Wasilewski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Dispatcher
Confirmed
Medium
Antonio Terceiro

Bug Description

If the script named 'run.sh' is downloaded before the test starts it overwrites the default test execution script. This is however a corner case and it should be enough to document the 'forbidden names' to warn users. Example yaml file that causes the problem:

metadata:
    name: passfail
    format: "Lava-Test-Shell Test Definition 1.0"
    description: "Pass/Fail test."

install:
    steps:
        - wget http://10.0.0.1/foo/test/run.sh -O test_run.sh
        - chmod +x test_run.sh

run:
    steps:
        - ./test_run.sh

parse:
    pattern: "(?P<test_case_id>[a-zA-Z0-9_-]+):\\s(?P<result>\\w+)"

Revision history for this message
Antonio Terceiro (terceiro) wrote : Re: [Bug 1213926] [NEW] naming test script 'run.sh' overwrites the script that runs the test

On Mon, Aug 19, 2013 at 01:37:21PM -0000, Milosz Wasilewski wrote:
> If the script named 'run.sh' is downloaded before the test starts it
> overwrites the default test execution script. This is however a corner
> case and it should be enough to document the 'forbidden names' to warn
> users. Example yaml file that causes the problem:
[...]
> install:
> steps:
> - wget http://10.0.0.1/foo/test/run.sh -O test_run.sh
> - chmod +x test_run.sh

I'm confused: you are not writing run.sh. To me it seems that this yaml
file *works around* the reported problem, instead of exposing it ... am
I missing something?

Revision history for this message
Milosz Wasilewski (mwasilew) wrote :

On 19 August 2013 20:37, Antonio Terceiro <email address hidden> wrote:
> On Mon, Aug 19, 2013 at 01:37:21PM -0000, Milosz Wasilewski wrote:
>> If the script named 'run.sh' is downloaded before the test starts it
>> overwrites the default test execution script. This is however a corner
>> case and it should be enough to document the 'forbidden names' to warn
>> users. Example yaml file that causes the problem:
> [...]
>> install:
>> steps:
>> - wget http://10.0.0.1/foo/test/run.sh -O test_run.sh
>> - chmod +x test_run.sh
>
> I'm confused: you are not writing run.sh. To me it seems that this yaml
> file *works around* the reported problem, instead of exposing it ... am
> I missing something?
>

copy/paste mistake in the bug. I pasted the yaml that works around the
problem :)
Yaml that caused the problem was like this:

install:
     steps:
         - wget http://10.0.0.1/foo/test/run.sh
         - chmod +x test_run.sh

Revision history for this message
Dave Pigott (dpigott) wrote :

We should not be downloading to the test directory

Changed in lava-dispatcher:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Antonio Terceiro (terceiro)
Revision history for this message
Antonio Terceiro (terceiro) wrote :

actually we should never write *anything* to the directory where the test definition is located

Revision history for this message
Tyler Baker (tyler-baker) wrote :

Any thoughts on a way forward on this issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.