From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hajime Tazaki Subject: Re: [RFC v2 21/37] lkl tools: "boot" test Date: Fri, 24 Jan 2020 13:32:03 +0900 Message-ID: References: <20200123193315.132434-1-brendanhiggins@google.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:36162 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbgAXEcM (ORCPT ); Thu, 23 Jan 2020 23:32:12 -0500 Received: by mail-pf1-f193.google.com with SMTP id w2so485019pfd.3 for ; Thu, 23 Jan 2020 20:32:11 -0800 (PST) In-Reply-To: <20200123193315.132434-1-brendanhiggins@google.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: brendanhiggins@google.com Cc: kunit-dev@googlegroups.com, tavi.purdila@gmail.com, mcgrof@kernel.org, davidgow@google.com, cyphar@cyphar.com, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, pscollins@google.com, cem@FreeBSD.org, motomuman@gmail.com, jiangshanlai@gmail.com, retrage01@gmail.com, petrosagg@gmail.com, liuyuan@google.com, thomas@tommie-lie.de, mark@stillwell.me, ddiss@suse.de, linux-kernel-library@freelists.org, luca.dariz@gmail.com Hello Brendan, On Fri, 24 Jan 2020 04:33:15 +0900, Brendan Higgins wrote: > > +int lkl_test_read(void) > > +{ > > + char buf[10] = { 0, }; > > + long ret; > > + > > + ret = lkl_sys_read(0, buf, sizeof(buf)); > > + > > + lkl_test_logf("lkl_sys_read=%ld buf=%s\n", ret, buf); > > + > > + if (ret == sizeof(wrbuf) && !strcmp(wrbuf, buf)) > > + return TEST_SUCCESS; > > + > > + return TEST_FAILURE; > > +} > > These tests make me think that LKL could be very useful for KUnit and > testing syscalls. > > Luis and I had been talking about writing KUnit tests for syscalls to > validate that syscalls conform to the expected behavior; however, > calling syscalls from the kernel obviously has issues. > > On the other hand, testing syscalls from a userspace on a booted kernel > is something that we do and something that needs to be done; however, > this too has some issues. Writing and running tests in userspace on a > booted kernel is not as easy as being able to write and run tests in the > kernel. Also, even though some syscall end-to-end tests are necessary, > not all syscall tests must be end-to-end tests, especially those which > are only trying to exercise the entire syscall contract. > > I think it looks like LKL might be able to help us square that circle. That's good to know :) > Hajime (and other LKL people): > > What is the current status of this patchset? I have not seen any > activity for a couple months. I've been a bit busy over the year-end term but recently restarted to work for the patchset to address the comments received from the discussion. > Luis, > > Does this kind of match what you were thinking with the syscall testing? > I think this looks pretty close. You should be able to fully test the > contract here using KUnit. Is there anyone else you think would be > interested in this? > > In any case, I am excited about this. Please keep me posted in the > future! I hope I can send v3 patches soon. Thanks for the interest ! -- Hajime