diff mbox

[KVM-AUTOTEST] Have Custom install chdir to test.bindir

Message ID 1242851931-8492-1-git-send-email-mburns@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mike Burns May 20, 2009, 8:38 p.m. UTC
If you are using custom install and load_modules=yes, then autotest needs to
change to the test.bindir so that it looks for kernel modules in the right
place.

Signed-off-by: Mike Burns <mburns@redhat.com>
---
 client/tests/kvm_runtest_2/kvm_install.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Avi Kivity May 24, 2009, 2:51 p.m. UTC | #1
Mike Burns wrote:
> If you are using custom install and load_modules=yes, then autotest needs to
> change to the test.bindir so that it looks for kernel modules in the right
> place.
>
> Signed-off-by: Mike Burns <mburns@redhat.com>
> ---
>  client/tests/kvm_runtest_2/kvm_install.py |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py
> index d1aceb2..ebd8b7d 100755
> --- a/client/tests/kvm_runtest_2/kvm_install.py
> +++ b/client/tests/kvm_runtest_2/kvm_install.py
> @@ -79,6 +79,7 @@ def run_kvm_install(test, params, env):
>  
>      # install from custom script
>      elif install_mode == "custom":
> +        os.chdir(test.bindir)
>          install_script = params.get("install_script")
>          script = os.path.join(test.bindir,install_script)
>          if not install_script:
>   

Don't you need to chdir back afterwards?

Opportunity for a with statement.
Mike Burns June 1, 2009, 6:39 p.m. UTC | #2
Avi Kivity wrote:
> Mike Burns wrote:
>> If you are using custom install and load_modules=yes, then autotest
>> needs to
>> change to the test.bindir so that it looks for kernel modules in the
>> right
>> place.
>>
>> Signed-off-by: Mike Burns <mburns@redhat.com>
>> ---
>>  client/tests/kvm_runtest_2/kvm_install.py |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/client/tests/kvm_runtest_2/kvm_install.py
>> b/client/tests/kvm_runtest_2/kvm_install.py
>> index d1aceb2..ebd8b7d 100755
>> --- a/client/tests/kvm_runtest_2/kvm_install.py
>> +++ b/client/tests/kvm_runtest_2/kvm_install.py
>> @@ -79,6 +79,7 @@ def run_kvm_install(test, params, env):
>>  
>>      # install from custom script
>>      elif install_mode == "custom":
>> +        os.chdir(test.bindir)
>>          install_script = params.get("install_script")
>>          script = os.path.join(test.bindir,install_script)
>>          if not install_script:
>>   
>
> Don't you need to chdir back afterwards?
>
> Opportunity for a with statement.
>
No, the custom install option essentially is replacing the call to
__install_kvm which does a chdir and doesn't ever revert back to the
original directory.  Either this is handled somewhere outside of the
kvm_install.py script or it is not necessary.

Mike
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py
index d1aceb2..ebd8b7d 100755
--- a/client/tests/kvm_runtest_2/kvm_install.py
+++ b/client/tests/kvm_runtest_2/kvm_install.py
@@ -79,6 +79,7 @@  def run_kvm_install(test, params, env):
 
     # install from custom script
     elif install_mode == "custom":
+        os.chdir(test.bindir)
         install_script = params.get("install_script")
         script = os.path.join(test.bindir,install_script)
         if not install_script: