Commit Graph

234 Commits

Author SHA1 Message Date
Tomasz Kulasek
8365e15666 test: fix load cuse module before test
Change-Id: Iaa2284b5e2de8ae563936d881c5ad7fa7a6b179d
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2637
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-06-01 09:21:48 +00:00
Seth Howell
4edb1e0370 test/autotest: sleep after clearing hugepage cache
Give the system some time to clear the hugepage cache
after we kick off that operation.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I18de5feee500dae456c6ba3d9759085bc6f4e96e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2280
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-05-11 12:29:07 +00:00
Michal Berger
844c8ec383 check_format: Reformat the Bash code in compliance with shfmt
Change-Id: I93e7b9d355870b0528a0ac3382fba1a10a558d45
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1718
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-05-07 20:52:21 +00:00
Seth Howell
a34329e831 autotest: clear system caches before running setup.sh.
This will help avoid the recent error with not being able
to allocate enough hugepages on VMs.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Iaf495458210da79501c7168104efe97c63b7afc7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2212
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-05-07 08:23:43 +00:00
Tomasz Zawadzki
63db535f14 test/cuse: move cuse specific tests outside of nvme-cli
Couple of nvme_cuse RPC operations were done as part of
nvme-cli test cases. This patch moves those out to separate
script.

Next patches in series will expand those.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia3123939901368af3570b127230f828437f39ef6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1920
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-23 07:27:36 +00:00
Michal Berger
dcae88350e test/lvol: Rewrite clear_method_none and clear_method_unmap to Bash
These are the final test cases from the series of ports, thus clean up
the python script and its lib as well.

Change-Id: I9923fc93fbeb8c2d54dd2dad5acae41eaf5cfff5
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/934
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-16 09:45:30 +00:00
Karol Latecki
dfa73e77b5 autotest.sh: save lcov files in output_dir
Coverage and ut_coverage files would get created in
spdk dir or in directory from which the autotest.sh was
called.

Use $output_dir provided by autotest_common.sh instead
to keep all build artifacts in common place.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Iaf009182441933cb5e9bd137d0c94078272dd749
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1134
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 08:08:16 +00:00
Tomasz Zawadzki
99cff8350b test: remove SPDK_TEST_EVENT flag
Test in event.sh take 5 seconds on CI at this time.
For the tests to run both SPDK_RUN_FUNCTIONAL_TEST
and SPDK_TEST_EVENT had to be enabled.

This served as very minor time saver, so removing
this flag shouldn't affter test times more that the
5 seconds.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie3eaa587daf28b2efbc3cfdff5ad648b7529e7f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1493
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:40 +00:00
Michal Berger
102731bd40 test/bdev: Split crypto test and convert it to RPC calls
Split is done based on the crypto driver type:
  - crypto_aesni
  - crypto_qat

Change-Id: I47610eea7dd69defcbda9aa801a8bd8eeab820ee
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1020
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:55:58 +00:00
Tomasz Zawadzki
3c92d9f166 test/compress: add selection of pmd to run test against
This will allow to test parts of compress bdev on systems
that do not have all types of PMDs.

Once case if for testing in VMs.

For reference on changes in execution time. Current times:
Per-patch = 8 seconds
Nightly = 84 seconds

Running the script twice in this patch, most likely doubles the time.
It is not an issue in per-patch, but if increasing nightly times is blocking
different solution could be done here.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I684569651f2290956f94fcec99cebf0fe13ba0d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1364
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-24 12:24:16 +00:00
Darek Stojaczyk
8b98cdb64a scripts/rpc.py: add daemon mode
Add rpc_cmd() bash command that sends rpc command to an
rpc.py instance permanently running in background.
This makes sending RPC commands even 17 times faster.

We make use of bash coprocesses - a builtin bash feature
that allow starting background processes with stdin and
stdout connected to pipes. rpc.py will block trying to
read stdin, effectively being always "ready" to read
an RPC command.

The background rpc.py is started with a new --server flag
that's described as:

> Start listening on stdin, parse each line as a regular
> rpc.py execution and create a separate connection for each command.
> Each command's output ends with either **STATUS=0 if the
> command succeeded or **STATUS=1 if it failed.
> --server is meant to be used in conjunction with bash
> coproc, where stdin and stdout are named pipes and can be
> used as a faster way to send RPC commands.

As a part of this patch I'm attaching a sample test
that runs the following rpc commands first with the regular
rpc.py, then the new rpc_cmd() function.

```
time {
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "0" ]

        malloc=$($rpc bdev_malloc_create 8 512)
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "1" ]

        $rpc bdev_passthru_create -b "$malloc" -p Passthru0
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "2" ]

        $rpc bdev_passthru_delete Passthru0
        $rpc bdev_malloc_delete $malloc
        bdevs=$($rpc bdev_get_bdevs)
        [ "$(jq length <<< "$bdevs")" == "0" ]
}
```

Regular rpc.py:
```
real    0m1.477s
user    0m1.289s
sys     0m0.139s
```

rpc_cmd():
```
real    0m0.085s
user    0m0.025s
sys     0m0.006s
```

autotest_common.sh will now spawn an rpc.py daemon if
it's not running yet, and it will offer rpc_cmd() function
to quickly send RPC commands. If the command is invalid or
SPDK returns with error, the bash function will return
a non-zero code and may trigger ERR trap just like a regular
rpc.py instance.

Pipes have major advantage over e.g. unix domain sockets - the pipes
will be automatically closed once the owner process exits.
This means we can create a named pipe in autotest_common.sh,
open it, then start rpc.py in background and never worry
about it again - it will be closed automatically once the
test exits. It doesn't even matter if the test is executed
manually in isolation, or as a part of the entire autotest.

(check_so_deps.sh needs to be modified not to wait for *all*
background processes to finish, but just the ones it started)

Change-Id: If0ded961b7fef3af3837b44532300dee8b5b4663
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/621
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-11 11:35:03 +00:00
Tomasz Kulasek
5b3c4b8783 test/nvme: nvme_rpc add test for bdev_nvme_apply_firmware
This patch introduces tests for basic RPC commands not used in
other tests:

	bdev_nvme_apply_firmware

Change-Id: I3a7aff1720108548b03d581fa7664d1ff5498be5
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/533
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-17 10:06:00 +00:00
Seth Howell
08add32896 test: add test to validate dpdk mem utility
This test essentially confirms that the new RPC properly creates a test
file and that the script can parse that file and run through a basic set
of operations and exit without an error.

Change-Id: Idf0c831020696a3a62fcef13171eedf3fcf63f5b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477867
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-01-24 05:46:43 +00:00
Karol Latecki
917976766d autotest.sh: add hello_blob to BlobFS tests
Hello_blob example was never run before in autotest.

Change-Id: I1f858bed816471efed947f06107cec981dd562a4
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481570
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-01-22 13:52:22 +00:00
Seth Howell
de30327534 test/blockdev: parameterize the blockdev tests.
Now we can actually know which tests we are running on which bdevs when
we call blockdev.sh. Removing the conditionals from the configuration
setup (or failing if they don't succeed) and then calling run_test from
the top level allows us to reliably track the bdev tests and fail if
they don't run on a desired class of bdev.

Change-Id: I14e6e3d993b4af4995adcbc5f138bac4ae9d63be
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478247
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-01-22 13:50:17 +00:00
Michael Haeuptle
bf4db834b9 lib/nvmf: Functional test for custom admin cmd handler
This test verifies the custom identify handler functionality
by querying the NVMe drive and comparing serial and model
number from the NVMe drive with the corresponding info
from the NVMF identify result.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I9d4edb1bf32550cbf5fbd45cbfa85f9afc408fc0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481910
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-01-20 09:56:35 +00:00
Wojciech Malikowski
f2c8083ef3 lib/ftl: Functional tests
This patch adjust functional tests to
new FTL stack.

Change-Id: I0b8ff08c61793d7f1685942031aecf9cc88d1f24
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468738
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-01-15 12:24:44 +00:00
Wojciech Malikowski
0178395e2c test/ftl: Temporarily disable FTL functional tests
Next patch in this chain will break FTL functional
test so disable it temporary until FTL refactor will
be finished.

Change-Id: I69168209163784e13fd5f56db9daa80b6709344f
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479701
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-01-15 12:24:44 +00:00
Seth Howell
a571eb03e9 test: move report_test_completion into run_test
This also requires us to change the create_test_list function to rely on
the run_test function for creating the canonical test list.

Change-Id: Ib35e7752935a3ac83de2702b6dfbd42539027f6a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476962
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-01-14 07:49:08 +00:00
Pawel Kaminski
6df3f23f22 test: Shellcheck - apply rule SC2097 and SC2098
SC2097: This assignment is only seen by the forked process.
SC2098: This expansion will not see the mentioned assignment.

Apply these two rules together as they point to the same code.

Change-Id: I61020e8fd4b6db2b06ae8134d1004290a9bef9e7
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-01-13 12:45:04 +00:00
Seth Howell
64569ea5e5 test: differentiate between different nvmf transports.
We have to do this explicitly so that the list of completed tests that
comes out at the end is explicit as well.

Change-Id: Ic89357f2ebd89ea80f00010a78b2a2ad05b22591
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476963
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-01-08 15:46:18 +00:00
Seth Howell
cb90136c33 test: eliminate case and suite from run_test
We will be able to distinguish case and suite in the post process
scripts based on if they have any internal tests.

Change-Id: Iff2aa5caa251924d8a842085d87eb2a17aca45d4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478522
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-24 08:24:42 +00:00
Tomasz Kulasek
bd3244325c test/nvme: add cuse smartctl tests
Change-Id: Id6ed39a4e6c4d360111aea96f630bb678f5b306e
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475754
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-12 14:52:20 +00:00
Seth Howell
1fafd71bc3 test: add timing calls to run_test
And clean out the corresponding calls to timing_enter and timing_exit
from the various test scripts.

Change-Id: I0759417b5a529e4c3649ce04cca1799c089da278
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476804
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-10 17:12:03 +00:00
Seth Howell
3710048472 test: add a test_name param to run_test
This will allow us to use timing_enter and timing_exit directly
inside the run_test function. That function already lends itself well to
nesting the way we do our timing.

This patch series is aimed at combining the timing_*, run_test, and
report_test_completions calls all into a single place. This will greatly
reduce the number of lines of code in our bash scripts devoted to
tracking timing, formatting, and test completion. It will also enable us
to expand on the reporting of test completions. Further down the line,
this will also allow us to unify test case documentation.

Change-Id: I8e1f4bcea86b2c3b88cc6e42339c57dfce4d58f2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476799
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-12-10 17:12:03 +00:00
Darek Stojaczyk
7fa9063148 test/lvol: start rewriting python tests to bash
There are multiple things wrong with current python tests:
 * they don't stop the execution on error
 * the output makes it difficult to understand what really
   happened inside the test
 * there is no easy way to reproduce a failure if there
   is one (besides running the same test script again)
 * they currently suffer from intermittent failures and
   there's no-one there to fix them
 * they stand out from the rest of spdk tests, which are
   written in bash

So we rewrite those tests to bash. They will use rpc.py
daemon to send RPC commands, so they won't take any more
time to run than python tests.

The tests are going to be split them into a few different
categories:
 * clones
 * snapshots
 * thin provisioning
 * tasting
 * renaming
 * resizing
 * all the dumb ones - construct, destruct, etc

Each file is a standalone test script, with common utility
functions located in test/lvol/common.sh. Each file tests
a single, specific feature, but under multiple conditions.
Each test case is implemented as a separate function, so
if you touch only one lvol feature, you can run only one
test script, and if e.g. only a later test case notoriously
breaks, you can comment out all the previous test case
invocations (up to ~10 lines) and focus only on that
failing one.

The new tests don't correspond 1:1 to the old python ones
- they now cover more. Whenever there was a negative test
to check if creating lvs on inexistent bdev failed, we'll
now also create a dummy bdev beforehand, so that lvs will
have more opportunity to do something it should not.
Some other test cases were squashed. A few negative tests
required a lot of setup just to try doing something
illegal and see if spdk crashed. We'll now do those illegal
operations in a single test case, giving lvol lib more
opportunity to break. Even if illegal operation did not
cause any segfault, is the lvolstore/lvol still usable?
E.g. if we try to create an lvol on an lvs that doesn't
have enough free clusters and it fails as expected, will
it be still possible to create a valid lvol afterwards?

Besides sending various RPC commands and checking their
return code, we'll also parse and compare various fields
in JSON RPC output from get_lvol_stores or get_bdevs RPC.
We'll use inline jq calls for that. Whenever something's
off, it will be clear which RPC returned invalid values
and what were the expected values even without having
detailed error prints.

The tests are designed to be as easy as possible to debug
whenever something goes wrong.

This patch removes one test case from python tests and
adds a corresponding test into the new test/lvol/lvol2.sh
file. The script will be renamed to just lvol.sh after
the existing lvol.sh (which starts all python tests) is
finally removed.

As for the bash script itself - each test case is run
through a run_test() function which verifies there were
no lvolstores, lvols, or bdevs left after the test case
has finished. Inside the particular tests we will still
check if the lvolstore removal at the end was successful,
but that's because we want to make sure it's gone e.g even
before we remove the underlying lvs' base bdev.

Change-Id: Iaa2bb656233e1c9f0c35093f190ac26c39e78623
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459517
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-06 14:58:44 +00:00
Maciej Wawryk
1aace53675 Add bdev_raid.sh to per-patch tests
The tests were made nightly with this patch:
85bedfac7a
It is no longer applies for two reasons:
    bdev_raid has seen and will see more changes in the future
    test take few second on the CI, meaning that they do not take up any
    meaningful part of CI time

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I5360c945549c08c81891bc733bb731ea9b93727e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475677
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-25 14:34:30 +00:00
Chunyang Hui
1f3b2a745f test/opal: disable revert clean up
We don't have opal test running in jenkins for now.
So disable this test and we can re-enable this when
we enable opal autotest.

Change-Id: I19ece0c37e6850c7b633539a402dc4b32c55320c
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475169
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-21 08:03:08 +00:00
Tomasz Kulasek
efbcd259ac lib/nvme: nvme character device tests
This patch adds new script to verify CUSE functionality for NVMe
devices:

 1) Starts spdk_tgt application
 2) Attaches first found controller
 3) Enables NVMe cuse devices for a controller and namespaces
 4) Retrieves CUSE device names for controller and namespaces
 4) Tests operations on exposed namespace devices
 5) Tests operations on controller devices

NOTE: These tests requires at least one NVMe device with at least one
      namespace available.


Change-Id: I5f5a7c86f8aefa73f12f4727f7520f16a599985b
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468828
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-25 09:07:51 +00:00
Chunyang Hui
2176f081dd test/opal: Enable OPAL test
Also add opal_revert_cleanup at the start of autotest.sh
because opal test might fail before revert and the drive
might be kept locked and will cause deny of service in
later test.

Change-Id: Icb9d571c59804daa559784cee457c7e804eff121
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471973
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-24 17:09:57 +00:00
Maciej Wawryk
f1131f1d19 test: Shellcheck - correct rule: loops over find output are fragile
Correct shellcheck rule SC2044: For loops over find output
are fragile. Use find -exec or a while read loop.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3fd84ab60daab7c6971769ff4dee8a24d5d3e1bb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470746
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-16 15:51:31 +00:00
Xiaodong Liu
3ce759a1d5 blobfs: add blobfs_detect RPC
Add module blobfs_bdev as a general module to simplify
the operations of blobfs on bdev. Then its functions
can be utilized by other libraries or apps.

blobfs_detect can be used to detect whether there is
one blobfs on given bdev.

Change-Id: Ib425574816061dc945fb652b539f791a44097a43
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466486
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 05:02:00 +00:00
Karol Latecki
3e2b0689a5 test/nvme: re-enable nvme hotplug test
New VM image for nvme hotplug tests was crafted,
test can be re-enabled.

Fixes #524

Change-Id: Ie7e5e063cd94f2d1cad4b0826f1a51fb43577e6c
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468807
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-09-20 20:24:57 +00:00
Mike Carlin
390542a39e spdkcli: Add support for TCP connection
Adds an option to spdkcli.py to allow connection over a tcp
via a host address and port. These options match the format
that exists in rpc.py

Signed-off-by: Mike Carlin <mikefcarlin@protonmail.com>
Change-Id: I7e9e1c376546dd765ffd6f4f4db88e193e9aa0ef
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467844
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-19 05:03:09 +00:00
Konrad Sztyber
29a9a3089a test/ftl: remove SPDK_TEST_BDEV_FTL
There were two variables controlling libftl's tests.  Only one of them
is actually needed (SPDK_TEST_FTL), so this patch removes the redundant
one.

Fixes #956

Change-Id: I125b9cb7d855351488b445da165be9e27f10f914
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467932
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-19 04:15:42 +00:00
Pawel Kaminski
eb401ec12e lib/rpc: Test if aliases are handled properly.
Use old rpc in conf.json to check
if rpc alias if handled properly.

Change-Id: I466e39dd6b4adf140225060e46752250ae30ddb4
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465666
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-08-30 15:54:26 +00:00
Darek Stojaczyk
32e5d08393 autotest: move compress test to the end
Currently the compression tests are run at the very
beginning of autotest. If someone makes any change
that breaks a generic SPDK component like RPC, he'll
find errors in that compression tests and may have
to wonder how he broke them without touching any
compress code.

To simplify root-causing and debugging, we want to
start with the most basic tests like env.sh, rpc_client.sh,
and blockdev.sh, so move the compress tests to the end.

Change-Id: If6b33d6e24841379ccd8ff6489c38a4081381ce9
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463850
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-08-02 05:21:50 +00:00
paul luse
b64ff135c5 test/compress: add bdevio and bdevperf tests
Will execute short run per patch, longer nightly. This
path only covers the ISAL PMD as there are QAT upgrades
needed in CI. It does so by using the new 'perform_tests'
RPC in both bdevio and bdevperf.

Change-Id: I93afda336d7411b695b2ddd0332cce0050d075a4
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455113
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Chunyang Hui <chunyang.hui@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-30 07:36:03 +00:00
Tomasz Zawadzki
deacebd5d5 test/blockdev: remove dependency on brd kernel module
AIO bdev works on any file available from kernel.
blockdev.sh is the only palce that uses the ramdisk
in the current autotest.sh.
After removing the /dev/ram0, aio bdev still gets tested
with regular file.

Note: the QoS functionality done on AIO0 still gets
tested in usual qos.sh tests.

Change-Id: I8d219206d49626582d5848239fb0c36b25ef92a1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-07-23 22:54:39 +00:00
Wojciech Malikowski
1d717c7cd9 test/vmd: Basic VMD tests
Added basic tests for NVMe disks behind VMD.

Change-Id: I9613ca4aa813bab16f4085ac809dbdc8028f1cfc
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459639
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-18 03:52:37 +00:00
Seth Howell
d19b101c41 test: add top level param for nvmf transport.
This is needed to create a job in jenkins that tests only the tcp
transport.

Change-Id: Iaa5a07617e9a241a9e4bd50105d5d5d1e849844e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460713
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2019-07-09 13:23:03 +00:00
Seth Howell
66203a88d6 test: add a fuzzer for the vhost API
Using the vhost_user API on the initiator side, we can craft arbitrary
requests to fuzz the vhost target APIs. This script currently supports
vhost_blk, but will support both vhost_blk and vhost_scsi.

Change-Id: I7f0af6ca2adabbc18b7029ea77b33f47fce9c16b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454682
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-08 09:18:19 +00:00
Tomasz Zawadzki
ef489303b4 net/vpp: include VPP into iSCSI test scripts
Tests that were thus far performed using posix net framework
can now be run with VPP. This patch adds network interface
configuration for VPP to work in iSCSI tests.

Some tests are disabled on purpose:
- IP Migration, RBD and NVMe-oF due to their tests lacking network
  namespace support
- rpc_config adding/deleting IP, as VPP has separate utility for that

calsoft.sh doesn't handle TCP stream properly and fails decoding iSCSI
requests when are divided by TCP segmentation. This is very common
situation for VPP and causes that calsoft.sh never PASS.

Change-Id: I7c80427ca1675a1789ce7440796cc8d9956f1c9e
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/394174
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 08:23:08 +00:00
Darek Stojaczyk
887aff4d09 test: remove duplicated set -ex from tests
It's always set in autotest_common.sh, there's no need
to set it again in each test script.

Change-Id: Ib14c4189c553dad54a3065c1a1d413a5fc5a5347
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457466
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-19 03:54:58 +00:00
Jim Harris
d53bfa7245 test/nvmf: allow user to pass transport type to nvmf.sh
Change autotest.sh to pass --transport=rdma.  But this
now allows someone to run nvmf.sh with --transport=tcp
to run all of the nvmf tests with the tcp transport!

Initial testing shows that bdevio.sh fails with tcp,
so only run this test with the rdma transport.  Issue
#808 has been filed - once it's resolved this
restriction can be removed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie50de4d67e504c84d6d8eebfe2b8c68b14f4ba2b

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456698
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
2019-06-04 23:04:54 +00:00
paul luse
85bedfac7a test: run bdev_raid.sh nightly instead of per patch
Existing raid UT already checks the logic in the raid
unmap code to intelligently send IOs to member disks.

The additional value of bdev_raid.sh is in doing a real
data validation on writes as well as confirmation that
unmaps really result in 0's following the action. Both of
these seem worth keeping however with the UT in place to
check the logic they are a better fit for nightly testing.

Change-Id: I1a758f4681d77dbddd4185162b0dd1f46525cabd
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454668
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-20 17:02:32 +00:00
Darek Stojaczyk
cff52180c4 autotest: don't source the configuration file in every test script
Most of our bash test scripts source autotest_common.sh
to be able to use some autotest-specific functions like
timing_enter(). The same test scripts allow specifying
custom command line parameters without actually realizing
that those parameters can be potentially picked up by
autotest_common.sh as well.

For example, if particular nvmf tests are run in "isolation"
mode by being executed with the first param set to "iso",
and there is a file named "iso" in the current dir, that
file will be sourced. This could be bad.

In this patch we stop sourcing or even processing $1 in
autotest_common.sh. Instead, the test configuration will
be sourced just once from autobuild.sh, autopackage.sh
and autotest.sh. If the user wants to run particular test
scripts manually, he should source an SPDK test configuration
by himself - manually as well. In most cases he won't even
have two, as only a few test scripts depend on SPDK_*
variables.

Note that we still have to setup the default values for
SPDK_* variables in autotest_common.sh because some of
our test scripts actually depend on them:

> if [ $SPDK_TEST_RBD -eq 1 ]; then ...

Because it lacks any type of quotes around SPDK_TEST_RBD,
it will print the following message when that variable
is unset:

> /bin/bash: line 0: [: -eq: unary operator expected

It doesn't trigger any error ($? == 0), but can be still
a bit misleading in the script output.

Change-Id: I350045d8582d66fe1ed7697d4bcbba324cb541ad
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453876
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-10 22:08:13 +00:00
Mike Carlin
fb6fbf3256 spdkcli: Add support for raid devices
Adds support to spdkcli.py for raid devices via UIRaidBdev with
functionality to construct and destroy raid bdevs.

Information regarding the raid can be viewed via 'show_details' on a
given pooled_device child in the tree.

Signed-off-by: Mike Carlin <mikefcarlin@protonmail.com>
Change-Id: I2ca89e641b201c09b3d4db070eac6cc0c2cdec73
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452774
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-05-09 19:36:35 +00:00
Pawel Niedzwiecki
0560976d51 test/common: Disable autotest options by default.
By default most of the tests are enabled, if we want to
run only tests that interests us, we need to disable each flag
separatly.
Build SPDK without additional dependencies and exit autotest.sh
early if no test configuration file is provided.

Change-Id: Id4752689479d9325242364c39c89d1236bab0344
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/443762
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-06 17:43:08 +00:00
paul luse
cd4de753af bdev/compress: prepare to add some unit tests
Misc cleanup from earlier patches, some naming issues and other
minor things that are needed before adding UT.

Change-Id: Ic76f0e2fd12e48782b048fb8785902b1098cf352
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436227
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 00:06:34 +00:00