From patchwork Fri Mar 1 08:28:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 159470 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp440628jad; Fri, 1 Mar 2019 00:29:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzbGgS1syIZt5qOAJOXFdkxxg7A7HahmeDtfPLgzRZvCNAgg124y9BT9auRG0o3hXudWsUh X-Received: by 2002:adf:9d13:: with SMTP id k19mr2619085wre.82.1551428942924; Fri, 01 Mar 2019 00:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551428942; cv=none; d=google.com; s=arc-20160816; b=m8596b6haITOiF6rur3bo74IYsQZBd+Ni0vwLyuDdQ5iMYwEnStUAe/jhizR8cWrmV Jsvu0l/f1lNSOgmWIlXeDICN9XvevFMdQfa2XnNup0TrirgdVM64p+LezGIb3/JdP17K kdzwFUUxw6aVTeVWid1RHUw+06xQ7zCOdIHDTPYt4AjThSdSRQ5HKSKVl2xiu9VOzVVO m2aApC/wLPeavqUaHazvi+Iu3gFVn8X+OQI4l4w0WAVJBF1dnjCRz24hw4o8uSzcJBPf ccrDOajWaA8tP75HfchlRJeyFxY5atHINMj/hTq4FBBVR5tw1+9Id76B7dlVjuaediVJ GGlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=y/BKAHUY6MCiochhF0RN4Ife2Jjz5CefMKMB+ssB/wc=; b=vSkFZOxG9TeFyrfA9XKb8y6Fisud8vEKHy/EKUsHkFiRbd0QQ6bmFLCxudpNyRJVpN XBP2EJzcjTaHZ72yASWCc86G3zCUfmydL3vPQtXoEpZNuomGkdiGbn32IvX5/hUfZhHn rABArrd7KkM+PPI952mCYIAwvoukUTDSqV2XlneYWwM6DexWD++zGkk7dKgNTHB17DFU 2ywO7BlOgpzEDf+thpZ1g+GqKDsTBPX6/ogUKro2+xvzv+hnu1HAq8JSuTKrJUlyxrQK efG84L5syPYmVv6GxH9PEnnJUzKUk3gbg9SNXQyJKvGFEVmrurRpr5j9L3nxW23b5EEV FSkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WqxdRjhw; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from picard.linux.it (picard.linux.it. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id z188si4510430wmb.189.2019.03.01.00.29.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Mar 2019 00:29:02 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WqxdRjhw; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7971B3EAD1A for ; Fri, 1 Mar 2019 09:29:02 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 4C14B3EAABE for ; Fri, 1 Mar 2019 09:28:55 +0100 (CET) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 950931A01CE9 for ; Fri, 1 Mar 2019 09:28:54 +0100 (CET) Received: by mail-pg1-x543.google.com with SMTP id h8so10583904pgp.6 for ; Fri, 01 Mar 2019 00:28:54 -0800 (PST) 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; bh=Pd+s854KAONHXfonFYvjgwBHqWtxRinnbvczDfpLPcM=; b=WqxdRjhwDs4H7IHlMjNEgRsbuf9BeuxuA6LEgg9j6oyCmQkuf/Fp9jnb1oxXugCPFk VciP/cTLK5p17AjhJ05xqUePhZq0+xS/1yjCGn0lc/F7wl9QmCtVDb9aXuYfNe9VZCNp bWVmQRp8Rjd1giGnbMSEvhy1IucIo94ifOFPAQWN44RFK8ApOHfDlUgt9P/l6xCX1UNu n6u/Vzl7ZTjbOEJSj07QklU01qKN2zDgkb7U+lzRMsI7Vk9G9hialyL3N/fTuZvI7aLX v4d1sLka5mAeqN4jsdYFPOTgk007avQMXx5rO5c/EZyjK6/Jh7Ix36SQIsoyeSVbQPV0 jeaA== 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; bh=Pd+s854KAONHXfonFYvjgwBHqWtxRinnbvczDfpLPcM=; b=me4OdZktp8sEXHntMSh7k35WlWhw5LM04e5YPTlulxx0Q2hJd8ZR9dIz8vJsJAbjO1 2+PqC0zx/KwcQen0+C2csGpeJ5Qk53oWyNj2FDFdJkts6J6KTZnn3J2f87PKZvE+zHft WhRKtdrfVIEi4TB9Vd3FlJ4Bam/8B2sQuCMCGqCC+vrPgj9JRVbtpkkjtAnw2oLXcwXY riwec9zVMxD69OYy8vSBS3KXIx+ARLIgTdlnTBi7yo6ccITcOebJyLFRpIMWPnnf93jS 0agJzDfTDFbzT3Iiq2FOiX5h4jueAPuUk4dUxeqDLN22rbmht08TkihLhXXt3bG0R1NF beBw== X-Gm-Message-State: AHQUAubmFNmnpU6J09w61Yr4k+AxQzp/f1Y7sG5IQ2zPHU+XmFdJBOtZ jWnrrHDWS6kMwCn8+cdLYZ409KwiHfklKg== X-Received: by 2002:a62:ae04:: with SMTP id q4mr4276904pff.213.1551428932778; Fri, 01 Mar 2019 00:28:52 -0800 (PST) Received: from localhost.localdomain ([117.252.69.94]) by smtp.gmail.com with ESMTPSA id h75sm34821720pfd.150.2019.03.01.00.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Mar 2019 00:28:52 -0800 (PST) From: Sumit Garg To: ltp@lists.linux.it Date: Fri, 1 Mar 2019 13:58:21 +0530 Message-Id: <1551428901-30162-2-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551428901-30162-1-git-send-email-sumit.garg@linaro.org> References: <1551428901-30162-1-git-send-email-sumit.garg@linaro.org> X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] doc: document new library functions X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" Document following library functions: 1. tst_fill_file() 2. tst_fill_fd() 3. tst_dev_bytes_written() Signed-off-by: Sumit Garg --- doc/test-writing-guidelines.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt index f2f72c4..a5fe589 100644 --- a/doc/test-writing-guidelines.txt +++ b/doc/test-writing-guidelines.txt @@ -1033,6 +1033,16 @@ results in 'umount(2)' failing with 'EBUSY'. IMPORTANT: All testcases should use 'tst_umount()' instead of 'umount(2)' to umount filesystems. +[source,c] +------------------------------------------------------------------------------- +#include "tst_test.h" + +unsigned long tst_dev_bytes_written(const char *dev); +------------------------------------------------------------------------------- + +This function reads test block device stat file (/sys/block//stat) and +returns the bytes written since the last invocation of this function. + 2.2.15 Formatting a device with a filesystem ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1142,6 +1152,24 @@ Returns non-zero if directory is empty and zero otherwise. Directory is considered empty if it contains only '.' and '..'. +[source,c] +------------------------------------------------------------------------------- +#include "tst_test.h" + +int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount); +------------------------------------------------------------------------------- + +Fill a file with specified pattern using file descriptor. + +[source,c] +------------------------------------------------------------------------------- +#include "tst_test.h" + +int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount); +------------------------------------------------------------------------------- + +Creates/ovewrites a file with specified pattern using file path. + 2.2.18 Getting an unused PID number ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^