qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests/277: Use iotests.sock_dir for socket creation
@ 2024-01-24 16:22 Andrey Drobyshev
  2024-01-24 17:43 ` Eric Blake
  2024-01-26 11:28 ` Kevin Wolf
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Drobyshev @ 2024-01-24 16:22 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, hreitz, kwolf, eblake, andrey.drobyshev, den

If socket path is too long (longer than 108 bytes), socket can't be
opened.  This might lead to failure when test dir path is long enough.
Make sure socket is created in iotests.sock_dir to avoid such a case.

This commit basically aligns iotests/277 with the rest of iotests.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
 tests/qemu-iotests/277 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277
index 24833e7eb6..4224202ac2 100755
--- a/tests/qemu-iotests/277
+++ b/tests/qemu-iotests/277
@@ -27,7 +27,8 @@ from iotests import file_path, log
 iotests.script_initialize()
 
 
-nbd_sock, conf_file = file_path('nbd-sock', 'nbd-fault-injector.conf')
+conf_file = file_path('nbd-fault-injector.conf')
+nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
 
 
 def make_conf_file(event):
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] iotests/277: Use iotests.sock_dir for socket creation
  2024-01-24 16:22 [PATCH] iotests/277: Use iotests.sock_dir for socket creation Andrey Drobyshev
@ 2024-01-24 17:43 ` Eric Blake
  2024-01-24 17:59   ` Denis V. Lunev
  2024-01-26 11:28 ` Kevin Wolf
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Blake @ 2024-01-24 17:43 UTC (permalink / raw)
  To: Andrey Drobyshev; +Cc: qemu-block, qemu-devel, hreitz, kwolf, den

On Wed, Jan 24, 2024 at 06:22:57PM +0200, Andrey Drobyshev wrote:
> If socket path is too long (longer than 108 bytes), socket can't be
> opened.  This might lead to failure when test dir path is long enough.
> Make sure socket is created in iotests.sock_dir to avoid such a case.
> 
> This commit basically aligns iotests/277 with the rest of iotests.
> 
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> ---
>  tests/qemu-iotests/277 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277
> index 24833e7eb6..4224202ac2 100755
> --- a/tests/qemu-iotests/277
> +++ b/tests/qemu-iotests/277
> @@ -27,7 +27,8 @@ from iotests import file_path, log
>  iotests.script_initialize()
>  
>  
> -nbd_sock, conf_file = file_path('nbd-sock', 'nbd-fault-injector.conf')
> +conf_file = file_path('nbd-fault-injector.conf')
> +nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
>  
>  
>  def make_conf_file(event):
> -- 
> 2.39.3
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iotests/277: Use iotests.sock_dir for socket creation
  2024-01-24 17:43 ` Eric Blake
@ 2024-01-24 17:59   ` Denis V. Lunev
  2024-01-25 13:54     ` Andrey Drobyshev
  0 siblings, 1 reply; 5+ messages in thread
From: Denis V. Lunev @ 2024-01-24 17:59 UTC (permalink / raw)
  To: Eric Blake, Andrey Drobyshev; +Cc: qemu-block, qemu-devel, hreitz, kwolf

On 1/24/24 18:43, Eric Blake wrote:
> On Wed, Jan 24, 2024 at 06:22:57PM +0200, Andrey Drobyshev wrote:
>> If socket path is too long (longer than 108 bytes), socket can't be
>> opened.  This might lead to failure when test dir path is long enough.
>> Make sure socket is created in iotests.sock_dir to avoid such a case.
>>
>> This commit basically aligns iotests/277 with the rest of iotests.
>>
>> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
>> ---
>>   tests/qemu-iotests/277 | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
>> diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277
>> index 24833e7eb6..4224202ac2 100755
>> --- a/tests/qemu-iotests/277
>> +++ b/tests/qemu-iotests/277
>> @@ -27,7 +27,8 @@ from iotests import file_path, log
>>   iotests.script_initialize()
>>   
>>   
>> -nbd_sock, conf_file = file_path('nbd-sock', 'nbd-fault-injector.conf')
>> +conf_file = file_path('nbd-fault-injector.conf')
>> +nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
>>   
>>   
>>   def make_conf_file(event):
>> -- 
>> 2.39.3
>>
I would say that potentially the same code is present
in 264, it is :
disk_a, disk_b, nbd_sock = file_path('disk_a', 'disk_b', 'nbd-sock')
nbd_uri = 'nbd+unix:///?socket=' + nbd_sock


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iotests/277: Use iotests.sock_dir for socket creation
  2024-01-24 17:59   ` Denis V. Lunev
@ 2024-01-25 13:54     ` Andrey Drobyshev
  0 siblings, 0 replies; 5+ messages in thread
From: Andrey Drobyshev @ 2024-01-25 13:54 UTC (permalink / raw)
  To: Denis V. Lunev, Eric Blake; +Cc: qemu-block, qemu-devel, hreitz, kwolf

On 1/24/24 19:59, Denis V. Lunev wrote:
> On 1/24/24 18:43, Eric Blake wrote:
>> On Wed, Jan 24, 2024 at 06:22:57PM +0200, Andrey Drobyshev wrote:
>>> If socket path is too long (longer than 108 bytes), socket can't be
>>> opened.  This might lead to failure when test dir path is long enough.
>>> Make sure socket is created in iotests.sock_dir to avoid such a case.
>>>
>>> This commit basically aligns iotests/277 with the rest of iotests.
>>>
>>> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
>>> ---
>>>   tests/qemu-iotests/277 | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>
>>> diff --git a/tests/qemu-iotests/277 b/tests/qemu-iotests/277
>>> index 24833e7eb6..4224202ac2 100755
>>> --- a/tests/qemu-iotests/277
>>> +++ b/tests/qemu-iotests/277
>>> @@ -27,7 +27,8 @@ from iotests import file_path, log
>>>   iotests.script_initialize()
>>>     -nbd_sock, conf_file = file_path('nbd-sock',
>>> 'nbd-fault-injector.conf')
>>> +conf_file = file_path('nbd-fault-injector.conf')
>>> +nbd_sock = file_path('nbd-sock', base_dir=iotests.sock_dir)
>>>       def make_conf_file(event):
>>> -- 
>>> 2.39.3
>>>
> I would say that potentially the same code is present
> in 264, it is :
> disk_a, disk_b, nbd_sock = file_path('disk_a', 'disk_b', 'nbd-sock')
> nbd_uri = 'nbd+unix:///?socket=' + nbd_sock

Thanks, have just sent a separate fix for iotests/264.  Haven't found
any others.

Andrey


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iotests/277: Use iotests.sock_dir for socket creation
  2024-01-24 16:22 [PATCH] iotests/277: Use iotests.sock_dir for socket creation Andrey Drobyshev
  2024-01-24 17:43 ` Eric Blake
@ 2024-01-26 11:28 ` Kevin Wolf
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2024-01-26 11:28 UTC (permalink / raw)
  To: Andrey Drobyshev; +Cc: qemu-block, qemu-devel, hreitz, eblake, den

Am 24.01.2024 um 17:22 hat Andrey Drobyshev geschrieben:
> If socket path is too long (longer than 108 bytes), socket can't be
> opened.  This might lead to failure when test dir path is long enough.
> Make sure socket is created in iotests.sock_dir to avoid such a case.
> 
> This commit basically aligns iotests/277 with the rest of iotests.
> 
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>

Thanks, applied to the block branch.

Kevin



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-26 11:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 16:22 [PATCH] iotests/277: Use iotests.sock_dir for socket creation Andrey Drobyshev
2024-01-24 17:43 ` Eric Blake
2024-01-24 17:59   ` Denis V. Lunev
2024-01-25 13:54     ` Andrey Drobyshev
2024-01-26 11:28 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).