You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "tmedicci (via GitHub)" <gi...@apache.org> on 2023/04/28 00:53:03 UTC
[GitHub] [nuttx-apps] tmedicci opened a new pull request, #1729: apps/examples/pipe: test file_pipe opening and closing
tmedicci opened a new pull request, #1729:
URL: https://github.com/apache/nuttx-apps/pull/1729
## Summary
Test `file_pipe()` opening and closing to make sure it doesn't block unexpectedly.
Also, print messages to stderr to avoid messing with the duplicated stdout.
## Impact
Test https://github.com/apache/nuttx/pull/9130
## Testing
Internal CI + sim:citest
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx-apps] tmedicci closed pull request #1729: apps/examples/pipe: test file_pipe opening and closing
Posted by "tmedicci (via GitHub)" <gi...@apache.org>.
tmedicci closed pull request #1729: apps/examples/pipe: test file_pipe opening and closing
URL: https://github.com/apache/nuttx-apps/pull/1729
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1729: apps/examples/pipe: test file_pipe opening and closing
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1729:
URL: https://github.com/apache/nuttx-apps/pull/1729#discussion_r1179907741
##########
examples/pipe/pipe_main.c:
##########
@@ -204,26 +206,59 @@ int main(int argc, FAR char *argv[])
if (ret != 0)
{
- fprintf(stderr, "pipe_main: PIPE test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: pipe() transfer_test test FAILED "
+ "(%d)\n", ret);
return 9;
}
- /* Perform the pipe redirection test */
+ fprintf(stderr, "pipe_main: pipe() transfer_test test PASSED\n");
+
+ /* Perform the pipe() redirection test */
- printf("\npipe_main: Performing redirection test\n");
+ fprintf(stderr, "\npipe_main: Performing pipe() redirection test\n");
ret = redirection_test();
if (ret != 0)
{
- fprintf(stderr, "pipe_main: PIPE redirection test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: pipe() redirection test FAILED (%d)\n",
+ ret);
return 10;
}
- printf("pipe_main: PIPE redirection test PASSED\n");
+ fprintf(stderr, "pipe_main: pipe() redirection test PASSED\n");
+
+ /* Test file_pipe() command */
+
+ fprintf(stderr, "\npipe_main: Open with file_pipe()\n");
+
+ filepipep[0] = &filepipe[0];
+ filepipep[1] = &filepipe[1];
+
+ ret = file_pipe(filepipep, CONFIG_DEV_PIPE_SIZE, 0);
Review Comment:
it isn't good to call kernel specific function from user space. let's test pipe or open_pty instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx-apps] tmedicci commented on a diff in pull request #1729: apps/examples/pipe: test file_pipe opening and closing
Posted by "tmedicci (via GitHub)" <gi...@apache.org>.
tmedicci commented on code in PR #1729:
URL: https://github.com/apache/nuttx-apps/pull/1729#discussion_r1180288550
##########
examples/pipe/pipe_main.c:
##########
@@ -204,26 +206,59 @@ int main(int argc, FAR char *argv[])
if (ret != 0)
{
- fprintf(stderr, "pipe_main: PIPE test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: pipe() transfer_test test FAILED "
+ "(%d)\n", ret);
return 9;
}
- /* Perform the pipe redirection test */
+ fprintf(stderr, "pipe_main: pipe() transfer_test test PASSED\n");
+
+ /* Perform the pipe() redirection test */
- printf("\npipe_main: Performing redirection test\n");
+ fprintf(stderr, "\npipe_main: Performing pipe() redirection test\n");
ret = redirection_test();
if (ret != 0)
{
- fprintf(stderr, "pipe_main: PIPE redirection test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: pipe() redirection test FAILED (%d)\n",
+ ret);
return 10;
}
- printf("pipe_main: PIPE redirection test PASSED\n");
+ fprintf(stderr, "pipe_main: pipe() redirection test PASSED\n");
+
+ /* Test file_pipe() command */
+
+ fprintf(stderr, "\npipe_main: Open with file_pipe()\n");
+
+ filepipep[0] = &filepipe[0];
+ filepipep[1] = &filepipe[1];
+
+ ret = file_pipe(filepipep, CONFIG_DEV_PIPE_SIZE, 0);
Review Comment:
You are right!
We'd need to test using pty, but it doesn't seem to fit on this test. I'll drop it for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org