Skip to content

Commit

Permalink
selftests: sparc64: char: Selftest for privileged ADI driver
Browse files Browse the repository at this point in the history
Add a selftest for the sparc64 privileged ADI driver.  These
tests verify the read(), pread(), write(), pwrite(), and seek()
functionality of the driver.  The tests also report simple
performance statistics:

        Syscall Call    AvgTime AvgSize
                Count   (ticks) (bytes)
        -------------------------------
        read          3  119638    8133
        pread         4  118164    6741
        write         3  339442    8133
        pwrite        4  280134    6741
        seek         10    2919       0
        Pass 8 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Allen Pais <allen.pais@oracle.com>
Reviewed-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Hromatka authored and David S. Miller committed Jun 5, 2018
1 parent 873c38a commit 3c54508
Show file tree
Hide file tree
Showing 7 changed files with 817 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TARGETS += ptrace
TARGETS += seccomp
TARGETS += sigaltstack
TARGETS += size
TARGETS += sparc64
TARGETS += splice
TARGETS += static_keys
TARGETS += sync
Expand Down
46 changes: 46 additions & 0 deletions tools/testing/selftests/sparc64/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
SUBDIRS := drivers

TEST_PROGS := run.sh

.PHONY: all clean

include ../lib.mk

all:
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
#SUBDIR test prog name should be in the form: SUBDIR_test.sh \
TEST=$$DIR"_test.sh"; \
if [ -e $$DIR/$$TEST ]; then \
rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \
fi \
done

override define RUN_TESTS
@cd $(OUTPUT); ./run.sh
endef

override define INSTALL_RULE
mkdir -p $(INSTALL_PATH)
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)

@for SUBDIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \
mkdir $$BUILD_TARGET -p; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
done;
endef

override define EMIT_TESTS
echo "./run.sh"
endef

override define CLEAN
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
done
endef
1 change: 1 addition & 0 deletions tools/testing/selftests/sparc64/drivers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
adi-test
15 changes: 15 additions & 0 deletions tools/testing/selftests/sparc64/drivers/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

INCLUDEDIR := -I.
CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g

TEST_GEN_FILES := adi-test

all: $(TEST_GEN_FILES)

$(TEST_GEN_FILES): adi-test.c

TEST_PROGS := drivers_test.sh

include ../../lib.mk

$(OUTPUT)/adi-test: adi-test.c
Loading

0 comments on commit 3c54508

Please sign in to comment.