Skip to content

Commit

Permalink
psh: touch tests improvements
Browse files Browse the repository at this point in the history
JIRA:
  • Loading branch information
mateusz-bloch committed Sep 25, 2023
1 parent 0595e2c commit 7010180
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 7 additions & 4 deletions psh/test-touch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
#

import psh.tools.psh as psh
import trunner.config as config
import trunner.ctx as ctx
from psh.tools.randwrapper import TestRandom
from psh.tools.common import (CHARS, assert_present, assert_file_created, assert_dir_created,
assert_random_files, get_rand_strings, create_testdir, assert_mtime)
assert_random_files, get_rand_strings, create_testdir,
assert_mtime, assert_dir_delete_rec)


ROOT_TEST_DIR = 'test_touch_dir'
Expand All @@ -26,7 +27,7 @@ def assert_executable(p):
# psh is the example of executable which exists in file system
msg = "Prompt hasn't been seen after the executable touch: /usr/bin/hello"
date = psh.date(p)
if config.CURRENT_TARGET in config.SYSEXEC_TARGETS:
if not ctx.target.rootfs:
psh.assert_cmd(p, 'touch /syspage/psh', result='success', msg=msg)
assert_mtime(p, {'psh': date}, '/syspage')
else:
Expand Down Expand Up @@ -75,7 +76,7 @@ def assert_existing_dirs(p):
# we assume that syspage directory exists on syspage targets and bin directory exists on root-fs targets
msg = "Prompt hasn't been seen after the executable touch: /usr/bin/hello"
date = psh.date(p)
if config.CURRENT_TARGET in config.SYSEXEC_TARGETS:
if not ctx.target.rootfs:
psh.assert_cmd(p, 'touch /syspage/', result='success', msg=msg)
assert_mtime(p, {'syspage': date}, '/')
else:
Expand Down Expand Up @@ -104,3 +105,5 @@ def harness(p):

assert_devices(p)
assert_executable(p)

assert_dir_delete_rec(p, ROOT_TEST_DIR)
3 changes: 0 additions & 3 deletions psh/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ test:
- name: touch
# TODO touch of netsocket and pf fails...
harness: test-touch.py
ignore: True

- name: touch-rootfs
harness: test-touch-rootfs.py
# temporary disabled because of the following issue: https://github.com/phoenix-rtos/phoenix-rtos-project/issues/621
ignore: true
targets:
exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo]

Expand Down

0 comments on commit 7010180

Please sign in to comment.