All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test
@ 2017-12-08 13:01 Michal Simek
  2017-12-08 14:34 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2017-12-08 13:01 UTC (permalink / raw)
  To: u-boot

Some QEMUs have a problem with time setup that's why
sleep test is failing. Introduce env__sleep_accurate
boardenv variable to have an option to skip sleep test.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v1:
- Change subject line and patch description
- Move from RFC to regular patch
- Remove boardidentity marker and use variable instead

 configs/zynq_zc706_defconfig |  1 +
 test/py/tests/test_sleep.py  | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
index 52999debc115..762b892f3fcf 100644
--- a/configs/zynq_zc706_defconfig
+++ b/configs/zynq_zc706_defconfig
@@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
index 64e057132622..ccef24d7f7b8 100644
--- a/test/py/tests/test_sleep.py
+++ b/test/py/tests/test_sleep.py
@@ -5,10 +5,23 @@
 import pytest
 import time
 
+"""
+Note: This test doesn't rely on boardenv_* configuration values but they can
+change test behavior.
+
+# Setup env__sleep_accurate to False if time is not accurate on your platform
+env__sleep_accurate = False
+
+"""
+
 def test_sleep(u_boot_console):
     """Test the sleep command, and validate that it sleeps for approximately
     the correct amount of time."""
 
+    sleep_skip = u_boot_console.config.env.get('env__sleep_accurate', True)
+    if not sleep_skip:
+        pytest.skip('sleep is not accurate')
+
     if u_boot_console.config.buildconfig.get('config_cmd_misc', 'n') != 'y':
         pytest.skip('sleep command not supported')
     # 3s isn't too long, but is enough to cross a few second boundaries.
-- 
1.9.1

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

* [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test
  2017-12-08 13:01 [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test Michal Simek
@ 2017-12-08 14:34 ` Tom Rini
  2017-12-08 14:44   ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2017-12-08 14:34 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 08, 2017 at 02:01:29PM +0100, Michal Simek wrote:
> Some QEMUs have a problem with time setup that's why
> sleep test is failing. Introduce env__sleep_accurate
> boardenv variable to have an option to skip sleep test.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Changes in v1:
> - Change subject line and patch description
> - Move from RFC to regular patch
> - Remove boardidentity marker and use variable instead
> 
>  configs/zynq_zc706_defconfig |  1 +

This looks unrelated.

>  test/py/tests/test_sleep.py  | 13 +++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
> index 52999debc115..762b892f3fcf 100644
> --- a/configs/zynq_zc706_defconfig
> +++ b/configs/zynq_zc706_defconfig
> @@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
>  CONFIG_CMD_EXT4_WRITE=y
>  CONFIG_CMD_FAT=y
>  CONFIG_CMD_FS_GENERIC=y
> +CONFIG_OF_EMBED=y
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_NET_RANDOM_ETHADDR=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
> diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
> index 64e057132622..ccef24d7f7b8 100644
> --- a/test/py/tests/test_sleep.py
> +++ b/test/py/tests/test_sleep.py
> @@ -5,10 +5,23 @@
>  import pytest
>  import time
>  
> +"""
> +Note: This test doesn't rely on boardenv_* configuration values but they can
> +change test behavior.
> +
> +# Setup env__sleep_accurate to False if time is not accurate on your platform
> +env__sleep_accurate = False

This should default to true.  Then a PR to uboot-test-hooks where you
say the file for zynq_zc702 has this false, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171208/46663813/attachment.sig>

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

* [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test
  2017-12-08 14:34 ` Tom Rini
@ 2017-12-08 14:44   ` Michal Simek
  2017-12-08 14:47     ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2017-12-08 14:44 UTC (permalink / raw)
  To: u-boot

On 8.12.2017 15:34, Tom Rini wrote:
> On Fri, Dec 08, 2017 at 02:01:29PM +0100, Michal Simek wrote:
>> Some QEMUs have a problem with time setup that's why
>> sleep test is failing. Introduce env__sleep_accurate
>> boardenv variable to have an option to skip sleep test.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Changes in v1:
>> - Change subject line and patch description
>> - Move from RFC to regular patch
>> - Remove boardidentity marker and use variable instead
>>
>>  configs/zynq_zc706_defconfig |  1 +
> 
> This looks unrelated.

yes it is sorry - I have tested it on local zc706
Will fix in v2.

> 
>>  test/py/tests/test_sleep.py  | 13 +++++++++++++
>>  2 files changed, 14 insertions(+)
>>
>> diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
>> index 52999debc115..762b892f3fcf 100644
>> --- a/configs/zynq_zc706_defconfig
>> +++ b/configs/zynq_zc706_defconfig
>> @@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
>>  CONFIG_CMD_EXT4_WRITE=y
>>  CONFIG_CMD_FAT=y
>>  CONFIG_CMD_FS_GENERIC=y
>> +CONFIG_OF_EMBED=y
>>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>>  CONFIG_NET_RANDOM_ETHADDR=y
>>  CONFIG_SPL_DM_SEQ_ALIAS=y
>> diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
>> index 64e057132622..ccef24d7f7b8 100644
>> --- a/test/py/tests/test_sleep.py
>> +++ b/test/py/tests/test_sleep.py
>> @@ -5,10 +5,23 @@
>>  import pytest
>>  import time
>>  
>> +"""
>> +Note: This test doesn't rely on boardenv_* configuration values but they can
>> +change test behavior.
>> +
>> +# Setup env__sleep_accurate to False if time is not accurate on your platform
>> +env__sleep_accurate = False
> 
> This should default to true.  Then a PR to uboot-test-hooks where you
> say the file for zynq_zc702 has this false, thanks!

This is just comment in that file. By default you can set it up to True
or just not setup at all.

Thanks,
Michal

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

* [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test
  2017-12-08 14:44   ` Michal Simek
@ 2017-12-08 14:47     ` Tom Rini
  2017-12-08 14:51       ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2017-12-08 14:47 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 08, 2017 at 03:44:58PM +0100, Michal Simek wrote:
> On 8.12.2017 15:34, Tom Rini wrote:
> > On Fri, Dec 08, 2017 at 02:01:29PM +0100, Michal Simek wrote:
> >> Some QEMUs have a problem with time setup that's why
> >> sleep test is failing. Introduce env__sleep_accurate
> >> boardenv variable to have an option to skip sleep test.
> >>
> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >> ---
> >>
> >> Changes in v1:
> >> - Change subject line and patch description
> >> - Move from RFC to regular patch
> >> - Remove boardidentity marker and use variable instead
> >>
> >>  configs/zynq_zc706_defconfig |  1 +
> > 
> > This looks unrelated.
> 
> yes it is sorry - I have tested it on local zc706
> Will fix in v2.
> 
> > 
> >>  test/py/tests/test_sleep.py  | 13 +++++++++++++
> >>  2 files changed, 14 insertions(+)
> >>
> >> diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
> >> index 52999debc115..762b892f3fcf 100644
> >> --- a/configs/zynq_zc706_defconfig
> >> +++ b/configs/zynq_zc706_defconfig
> >> @@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
> >>  CONFIG_CMD_EXT4_WRITE=y
> >>  CONFIG_CMD_FAT=y
> >>  CONFIG_CMD_FS_GENERIC=y
> >> +CONFIG_OF_EMBED=y
> >>  CONFIG_ENV_IS_IN_SPI_FLASH=y
> >>  CONFIG_NET_RANDOM_ETHADDR=y
> >>  CONFIG_SPL_DM_SEQ_ALIAS=y
> >> diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
> >> index 64e057132622..ccef24d7f7b8 100644
> >> --- a/test/py/tests/test_sleep.py
> >> +++ b/test/py/tests/test_sleep.py
> >> @@ -5,10 +5,23 @@
> >>  import pytest
> >>  import time
> >>  
> >> +"""
> >> +Note: This test doesn't rely on boardenv_* configuration values but they can
> >> +change test behavior.
> >> +
> >> +# Setup env__sleep_accurate to False if time is not accurate on your platform
> >> +env__sleep_accurate = False
> > 
> > This should default to true.  Then a PR to uboot-test-hooks where you
> > say the file for zynq_zc702 has this false, thanks!
> 
> This is just comment in that file. By default you can set it up to True
> or just not setup at all.

Ah, OK, I was reading too quickly.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171208/0277dbe9/attachment.sig>

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

* [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test
  2017-12-08 14:47     ` Tom Rini
@ 2017-12-08 14:51       ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2017-12-08 14:51 UTC (permalink / raw)
  To: u-boot

On 8.12.2017 15:47, Tom Rini wrote:
> On Fri, Dec 08, 2017 at 03:44:58PM +0100, Michal Simek wrote:
>> On 8.12.2017 15:34, Tom Rini wrote:
>>> On Fri, Dec 08, 2017 at 02:01:29PM +0100, Michal Simek wrote:
>>>> Some QEMUs have a problem with time setup that's why
>>>> sleep test is failing. Introduce env__sleep_accurate
>>>> boardenv variable to have an option to skip sleep test.
>>>>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>> Changes in v1:
>>>> - Change subject line and patch description
>>>> - Move from RFC to regular patch
>>>> - Remove boardidentity marker and use variable instead
>>>>
>>>>  configs/zynq_zc706_defconfig |  1 +
>>>
>>> This looks unrelated.
>>
>> yes it is sorry - I have tested it on local zc706
>> Will fix in v2.
>>
>>>
>>>>  test/py/tests/test_sleep.py  | 13 +++++++++++++
>>>>  2 files changed, 14 insertions(+)
>>>>
>>>> diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
>>>> index 52999debc115..762b892f3fcf 100644
>>>> --- a/configs/zynq_zc706_defconfig
>>>> +++ b/configs/zynq_zc706_defconfig
>>>> @@ -37,6 +37,7 @@ CONFIG_CMD_EXT4=y
>>>>  CONFIG_CMD_EXT4_WRITE=y
>>>>  CONFIG_CMD_FAT=y
>>>>  CONFIG_CMD_FS_GENERIC=y
>>>> +CONFIG_OF_EMBED=y
>>>>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>>>>  CONFIG_NET_RANDOM_ETHADDR=y
>>>>  CONFIG_SPL_DM_SEQ_ALIAS=y
>>>> diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
>>>> index 64e057132622..ccef24d7f7b8 100644
>>>> --- a/test/py/tests/test_sleep.py
>>>> +++ b/test/py/tests/test_sleep.py
>>>> @@ -5,10 +5,23 @@
>>>>  import pytest
>>>>  import time
>>>>  
>>>> +"""
>>>> +Note: This test doesn't rely on boardenv_* configuration values but they can
>>>> +change test behavior.
>>>> +
>>>> +# Setup env__sleep_accurate to False if time is not accurate on your platform
>>>> +env__sleep_accurate = False
>>>
>>> This should default to true.  Then a PR to uboot-test-hooks where you
>>> say the file for zynq_zc702 has this false, thanks!
>>
>> This is just comment in that file. By default you can set it up to True
>> or just not setup at all.
> 
> Ah, OK, I was reading too quickly.  Thanks!

No worries. Will wait for Stephen and then will send PR to
uboot-test-hooks and also I can remove sleep from .travis.yml.

Thanks,
Michal

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

end of thread, other threads:[~2017-12-08 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 13:01 [U-Boot] [PATCH v1] test: py: Add an option to skip sleep test Michal Simek
2017-12-08 14:34 ` Tom Rini
2017-12-08 14:44   ` Michal Simek
2017-12-08 14:47     ` Tom Rini
2017-12-08 14:51       ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.