From patchwork Thu Apr 19 13:58:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 10350449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B00896023A for ; Thu, 19 Apr 2018 14:07:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A00322580E for ; Thu, 19 Apr 2018 14:07:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9474926E5D; Thu, 19 Apr 2018 14:07:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F0933283B9 for ; Thu, 19 Apr 2018 14:07:46 +0000 (UTC) Received: from localhost ([::1]:49938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADx-0004b0-Tp for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Apr 2018 10:07:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5m-00065B-0Z for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5k-0002Od-SB for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:18 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:45433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5k-0002MM-LV for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:16 -0400 Received: by mail-wr0-x242.google.com with SMTP id u11-v6so14326933wri.12 for ; Thu, 19 Apr 2018 06:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GLwVMwJJxQKYPCdpmP8VCCwUe/OSKjPOWcKfs+oHnq0=; b=cy3AfY2IeG27WUSLeGTWb9bf7xutDtrZzVnkoDjMuZLVZmMfkPoq1h0EbbLhYG8Ltc aJ91nwrghzCoj3+mRHEPOhTHzGfIFqGv9anJLZITkA+IsR9uZKMb4eQvkFDPr9/Y2yfV wti6ro0xQeaV17/lb4P+ZJ39VC5JaQWckvi1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GLwVMwJJxQKYPCdpmP8VCCwUe/OSKjPOWcKfs+oHnq0=; b=jZdlHksKxdAkmG2wCUyZMxt6I3JROxM452koWCq7VmCrbZfABDJEaMGWqzEpmlsEzm Ni0NdFIAYT8GdHb1l182XgOyEa97WL9pe8JO8DVQosxu6UPEIxhpLPeHCUrx+lgm5xq0 ViCcVjHIQ4BeaHhelpJvlM9BD1VXC30YgHtEaK9oJhTWIUpXPvf5fsq81RnKVeJvIT5V yxOn0MsJCLPRmTFJGJqiXfIUSucgZu90nuXkhX1VA7UYAbWKADe4ddrO4JoeuRA9DLFZ SCnZsASE/No05pH++r/tARAtDQpLO9Wf7bLkYjbH4een1BYGtfgGTnxDxUH4A3i7fJVX XPUg== X-Gm-Message-State: ALQs6tCTOpuAI+nGUGZCkdpGzep7cIdsg5AGiS2N+QX4bO1E5YozR7d7 u0/IoIb1q0Vu6obmrd+wfJoPXg== X-Google-Smtp-Source: AIpwx4+DBKT8hMzAFQCkrBFiRooQ4LTBKxX/t1A8YVEUakfWJIZ/d7eoTvyF2sdiFIwXk0wdG3FLfg== X-Received: by 2002:adf:a0a2:: with SMTP id m31-v6mr4895969wrm.278.1524146355454; Thu, 19 Apr 2018 06:59:15 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 33-v6sm3129810wrs.74.2018.04.19.06.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 93EB83E0481; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:32 +0100 Message-Id: <20180419135901.30035-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 14/43] tests/tcg/multiarch: enable additional linux-test tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Un-comment the remaining tests. I removed the itimer value tests because I'm fairly sure a re-arming timer will always have a different value in it when you grab it. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/multiarch/linux-test.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index 4457bd04ba..519b0ac653 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ +#define _GNU_SOURCE #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #define TESTPATH "/tmp/linux-test.tmp" #define TESTPORT 7654 @@ -58,8 +60,8 @@ static void error1(const char *filename, int line, const char *fmt, ...) static int __chk_error(const char *filename, int line, int ret) { if (ret < 0) { - error1(filename, line, "%m (ret=%d, errno=%d)", - ret, errno); + error1(filename, line, "%m (ret=%d, errno=%d/%s)", + ret, errno, strerror(errno)); } return ret; } @@ -320,7 +322,6 @@ static void test_socket(void) chk_error(close(server_fd)); } -#if 0 #define WCOUNT_MAX 512 static void test_pipe(void) @@ -355,7 +356,7 @@ static void test_pipe(void) } if (FD_ISSET(fds[1], &wfds)) { ch = 'a'; - chk_error(write(fds[0], &ch, 1)); + chk_error(write(fds[1], &ch, 1)); wcount++; } } @@ -408,7 +409,6 @@ void test_clone(void) thread2_res != 6) error("clone"); } -#endif /***********************************/ @@ -449,12 +449,10 @@ static void test_signal(void) it.it_value.tv_usec = 10 * 1000; chk_error(setitimer(ITIMER_REAL, &it, NULL)); chk_error(getitimer(ITIMER_REAL, &oit)); - if (oit.it_value.tv_sec != it.it_value.tv_sec || - oit.it_value.tv_usec != it.it_value.tv_usec) - error("itimer"); while (alarm_count < 5) { usleep(10 * 1000); + getitimer(ITIMER_REAL, &oit); } it.it_interval.tv_sec = 0; @@ -463,9 +461,6 @@ static void test_signal(void) it.it_value.tv_usec = 0; memset(&oit, 0xff, sizeof(oit)); chk_error(setitimer(ITIMER_REAL, &it, &oit)); - if (oit.it_value.tv_sec != 0 || - oit.it_value.tv_usec != 10 * 1000) - error("setitimer"); /* SIGSEGV test */ act.sa_sigaction = sig_segv; @@ -503,10 +498,11 @@ static void test_shm(void) int main(int argc, char **argv) { test_file(); + test_pipe(); test_fork(); test_time(); test_socket(); - // test_clone(); + test_clone(); test_signal(); test_shm(); return 0;