tests/kms_pipe_crc_basic: expect setting bad source to fail

Submitted by Mahesh Kumar on July 2, 2018, 11:16 a.m.

Details

Message ID 20180702111613.8326-1-mahesh1.kumar@intel.com
State New
Series "tests/kms_pipe_crc_basic: expect setting bad source to fail"
Headers show

Commit Message

Mahesh Kumar July 2, 2018, 11:16 a.m.
Now crc-core framework verifies the source string passed by the user.
So setting bad-source will fail. Expect file write to fail in bad-source
subtest of kms_pipe_crc_basic.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
---
 tests/kms_pipe_crc_basic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 235fdc38..2d4dfee8 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -48,8 +48,7 @@  static struct {
 
 static void test_bad_source(data_t *data)
 {
-	igt_assert(igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
-	igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1);
+	igt_assert(!igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
 }
 
 #define N_CRCS	3

Comments

Maarten Lankhorst July 2, 2018, 11:27 a.m.
Op 02-07-18 om 13:16 schreef Mahesh Kumar:
> Now crc-core framework verifies the source string passed by the user.
> So setting bad-source will fail. Expect file write to fail in bad-source
> subtest of kms_pipe_crc_basic.
>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> ---
>  tests/kms_pipe_crc_basic.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> index 235fdc38..2d4dfee8 100644
> --- a/tests/kms_pipe_crc_basic.c
> +++ b/tests/kms_pipe_crc_basic.c
> @@ -48,8 +48,7 @@ static struct {
>  
>  static void test_bad_source(data_t *data)
>  {
> -	igt_assert(igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
> -	igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1);
> +	igt_assert(!igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
>  }
>  
>  #define N_CRCS	3

New behavior makes more sense.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Do you have igt commit rights?
Mahesh Kumar July 3, 2018, 6:04 a.m.
Hi,


On 7/2/2018 4:57 PM, Maarten Lankhorst wrote:
> Op 02-07-18 om 13:16 schreef Mahesh Kumar:
>> Now crc-core framework verifies the source string passed by the user.
>> So setting bad-source will fail. Expect file write to fail in bad-source
>> subtest of kms_pipe_crc_basic.
>>
>> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
>> ---
>>   tests/kms_pipe_crc_basic.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
>> index 235fdc38..2d4dfee8 100644
>> --- a/tests/kms_pipe_crc_basic.c
>> +++ b/tests/kms_pipe_crc_basic.c
>> @@ -48,8 +48,7 @@ static struct {
>>   
>>   static void test_bad_source(data_t *data)
>>   {
>> -	igt_assert(igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
>> -	igt_assert(openat(data->debugfs, "crtc-0/crc/data", O_WRONLY) == -1);
>> +	igt_assert(!igt_sysfs_set(data->debugfs, "crtc-0/crc/control", "foo"));
>>   }
>>   
>>   #define N_CRCS	3
> New behavior makes more sense.
>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
> Do you have igt commit rights?
thanks for review.
I don't have commit rights
-Mahesh