diff mbox series

tests/unit/test-qga: do not qualify executable paths

Message ID 20240103165131.2166988-1-sam@rfc1149.net
State New
Headers show
Series tests/unit/test-qga: do not qualify executable paths | expand

Commit Message

Samuel Tardieu Jan. 3, 2024, 4:51 p.m. UTC
guest-exec invocation does not need the full path of the executable to
execute. Using only the command names ensures correct execution of the
test on systems not adhering to the FHS.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 tests/unit/test-qga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Daniel P. Berrangé Jan. 3, 2024, 5 p.m. UTC | #1
On Wed, Jan 03, 2024 at 05:51:31PM +0100, Samuel Tardieu wrote:
> guest-exec invocation does not need the full path of the executable to
> execute. Using only the command names ensures correct execution of the
> test on systems not adhering to the FHS.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>  tests/unit/test-qga.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
Philippe Mathieu-Daudé Jan. 3, 2024, 5:34 p.m. UTC | #2
On 3/1/24 17:51, Samuel Tardieu wrote:
> guest-exec invocation does not need the full path of the executable to
> execute. Using only the command names ensures correct execution of the
> test on systems not adhering to the FHS.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   tests/unit/test-qga.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Konstantin Kostiuk Jan. 16, 2024, 5:24 p.m. UTC | #3
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Wed, Jan 3, 2024 at 7:34 PM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> On 3/1/24 17:51, Samuel Tardieu wrote:
> > guest-exec invocation does not need the full path of the executable to
> > execute. Using only the command names ensures correct execution of the
> > test on systems not adhering to the FHS.
> >
> > Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> > ---
> >   tests/unit/test-qga.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>
>
diff mbox series

Patch

diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c
index 671e83cb86..8cddf5dc37 100644
--- a/tests/unit/test-qga.c
+++ b/tests/unit/test-qga.c
@@ -822,7 +822,7 @@  static void test_qga_guest_exec(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/echo', 'arg': [ '-n', '\" test_str \"' ],"
+                 " 'path': 'echo', 'arg': [ '-n', '\" test_str \"' ],"
                  " 'capture-output': true } }");
     g_assert_nonnull(ret);
     qmp_assert_no_error(ret);
@@ -883,7 +883,7 @@  static void test_qga_guest_exec_separated(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/bash',"
+                 " 'path': 'bash',"
                  " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ],"
                  " 'capture-output': 'separated' } }");
     g_assert_nonnull(ret);
@@ -924,7 +924,7 @@  static void test_qga_guest_exec_merged(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/bash',"
+                 " 'path': 'bash',"
                  " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ],"
                  " 'capture-output': 'merged' } }");
     g_assert_nonnull(ret);