From patchwork Wed Dec 13 14:49:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 847998 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yxfj95Sd3z9s7g for ; Thu, 14 Dec 2017 01:49:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbdLMOtP (ORCPT ); Wed, 13 Dec 2017 09:49:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbdLMOtN (ORCPT ); Wed, 13 Dec 2017 09:49:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC8F0C047B97; Wed, 13 Dec 2017 14:49:13 +0000 (UTC) Received: from localhost (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 976A77E201; Wed, 13 Dec 2017 14:49:12 +0000 (UTC) From: Stefan Hajnoczi To: netdev@vger.kernel.org Cc: Jorgen Hansen , Dexuan Cui , Stefan Hajnoczi Subject: [PATCH 0/5] VSOCK: add vsock_test test suite Date: Wed, 13 Dec 2017 14:49:06 +0000 Message-Id: <20171213144911.6428-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 13 Dec 2017 14:49:13 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The vsock_diag.ko module already has a test suite but the core AF_VSOCK functionality has no tests. This patch series adds several test cases that exercise AF_VSOCK SOCK_STREAM socket semantics (send/recv, connect/accept, half-closed connections, simultaneous connections). The test suite is modest but I hope to cover additional cases in the future. My goal is to have a shared test suite so VMCI, Hyper-V, and KVM can ensure that our transports behave the same. I have tested virtio-vsock. Jorgen: Please test the VMCI transport and let me know if anything needs to be adjusted. See tools/testing/vsock/README for information on how to run the test suite. Dexuan: I'm not sure if this test suite is useful for the Hyper-V transport since the host is Windows and uses a different API for AF_HYPERV? Stefan Hajnoczi (5): VSOCK: extract utility functions from vsock_diag_test.c VSOCK: extract connect/accept functions from vsock_diag_test.c VSOCK: add full barrier between test cases VSOCK: add send_byte()/recv_byte() test utilities VSOCK: add AF_VSOCK test cases tools/testing/vsock/Makefile | 7 +- tools/testing/vsock/util.h | 43 +++++ tools/testing/vsock/util.c | 291 ++++++++++++++++++++++++++++++ tools/testing/vsock/vsock_diag_test.c | 167 +++--------------- tools/testing/vsock/vsock_test.c | 321 ++++++++++++++++++++++++++++++++++ tools/testing/vsock/.gitignore | 1 + tools/testing/vsock/README | 1 + 7 files changed, 685 insertions(+), 146 deletions(-) create mode 100644 tools/testing/vsock/util.h create mode 100644 tools/testing/vsock/util.c create mode 100644 tools/testing/vsock/vsock_test.c