smokey/rtdm: account for device teardown
PATCH 1/2 smokey/rtdm: account for device teardown
Since recently, RTDM forcibly disconnects files from a device being unregistered. This has to change the expectations the smokey test may have about the rmmod logic.
--- testsuite/smokey/rtdm/rtdm.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-)
testsuite/smokey/rtdm/rtdm.c +1 -20
@@ -55,21 +55,6 @@ static void check_inner(const char *fn, int line, const char *msg, __status; \ }) -static void check_sleep_inner (const char *fn,int line, -const char *msg,unsigned long long start) -{ -unsigned long long diff =timer_tsc2ns (timer_get_tsc () - start); - -if (diff <300 *NS_PER_MS ) { -fprintf (stderr,"FAILED %s:%d: %s waited only %Ld.%06u ms\n" , - fn, line, msg, diff /1000000 , - (unsigned )(diff %1000000 )); -exit (EXIT_FAILURE ); - } -} -#define check_sleep (msg, start) \ - check_sleep_inner(__func__, __LINE__, msg, start) -static const char *devname ="/dev/rtdm/rtdm0" ;static const char *devname2 ="/dev/rtdm/rtdm1" ;
@@ -166,7 +151,6 @@ static int test_handover(int fd)static int run_rtdm (struct smokey_test *t,int argc,char *const argv[]) { -unsigned long long start;int dev, dev2, status; status =system ("modprobe -q xeno_rtdmtest" );
@@ -194,7 +178,6 @@ static int run_rtdm(struct smokey_test *t, int argc, char *const argv[])smokey_trace ("Defer close by pending reference" );check ("ioctl" ,ioctl (dev,RTTST_RTIOC_RTDM_DEFER_CLOSE ,RTTST_RTDM_DEFER_CLOSE_CONTEXT ),0 ); - start =timer_get_tsc ();check ("close" ,close (dev),0 );check ("open" ,open (devname,O_RDWR ), -EBUSY ); dev2 =check ("open" ,open (devname2,O_RDWR ), dev);
@@ -208,13 +191,11 @@ static int run_rtdm(struct smokey_test *t, int argc, char *const argv[])check ("close" ,close (dev),0 ); dev =check ("open" ,open (devname,O_RDWR ), dev); -smokey_trace ("Deferred module unload" ); +smokey_trace ("Disconnect on module unload" );check ("ioctl" ,ioctl (dev,RTTST_RTIOC_RTDM_DEFER_CLOSE ,RTTST_RTDM_DEFER_CLOSE_CONTEXT ),0 ); - start =timer_get_tsc ();check ("close" ,close (dev),0 );check ("rmmod" ,system ("rmmod xeno_rtdmtest" ),0 ); -check_sleep ("rmmod" , start);return 0 ; }
Signature · 1 line
2.21.0
PATCH 2/2 lib/smokey: consider PATH in smokey_fork_exec()
Prefer execlp() over execl() for bootstrapping a new image: callers may assume that PATH should be considered when searching for the executable file, e.g. posix_fork test.
--- lib/smokey/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/smokey/helpers.c +1 -1
@@ -276,7 +276,7 @@ int smokey_fork_exec(const char *path, const char *arg)case -1 :error (1 , errno,"fork/vfork" );case 0 : -execl (path, arg,NULL ); +execlp (path, arg,NULL );error (1 , errno,"execl %s" , path);default :waitpid (pid, &wstatus,0 );
Signature · 1 line
2.21.0
Re: [PATCH 2/2] lib/smokey: consider PATH in smokey_fork_exec()
Quoted 15 lines · Philippe Gerum
Prefer
execlp()overexecl()for bootstrapping a new image: callers may assume that PATH should be considered when searching for the executable file, e.g.posix_forktest.Signed-off-by Philippe Gerum <[email protected]>--- lib/smokey/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/smokey/helpers.c +0
-0
lib/smokey/helpers.c int smokey_fork_exec(const char *path, const char *arg) · line 282
Quoted 8 lines
lib/smokey/helpers.c +1
-1@@ -276,7 +276,7 @@ int smokey_fork_exec(const char *path, const char *arg)case -1 :error (1 , errno,"fork/vfork" );case 0 : -execl (path, arg,NULL ); +execlp (path, arg,NULL );error (1 , errno,"execl %s" , path);default :waitpid (pid, &wstatus,0 );
Both applied, thanks.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux