k8s.io/kubernetes@v1.29.3/test/e2e/storage/external/README.md (about)

     1  When a test suite like test/e2e/e2e.test from Kubernetes includes this
     2  package, the `-storage.testdriver` parameter can be used one or more
     3  times to enabling testing of a certain pre-installed storage driver.
     4  
     5  The parameter takes as argument the name of a .yaml or .json file. The
     6  filename can be absolute or relative to `--repo-root`. The content of
     7  the file is used to populate a struct that defines how to test the
     8  driver. For a full definition of the content see:
     9  - `struct driverDefinition` in [external.go](./external.go)
    10  - `struct TestDriver` and the `Cap` capability constants in [testdriver.go](../framework/testdriver.go)
    11  
    12  Here is a minimal example for the CSI hostpath driver:
    13  
    14      StorageClass:
    15        FromName: true
    16      SnapshotClass:
    17        FromName: true
    18      DriverInfo:
    19        Name: hostpath.csi.k8s.io
    20        Capabilities:
    21          persistence: true
    22  
    23  The `prow.sh` script of the different CSI hostpath driver releases
    24  generates the actual definition that is used during CI testing, for
    25  example in
    26  [v1.2.0](https://github.com/kubernetes-csi/csi-driver-host-path/blob/v1.2.0/release-tools/prow.sh#L748-L763).
    27  
    28  Currently there is no checking for unknown fields, i.e. only file
    29  entries that match with struct entries are used and other entries are
    30  silently ignored, so beware of typos.
    31  
    32  For each driver, the storage tests from `test/e2e/storage/testsuites`
    33  are added for that driver with `External Storage [Driver: <Name>]` as
    34  prefix.
    35  
    36  To run just those tests for the example above, put that content into
    37  `/tmp/hostpath-testdriver.yaml`, ensure `e2e.test` is in your PATH or current directory (downloaded from a test tarball like https://dl.k8s.io/release/v1.14.0/kubernetes-test-linux-amd64.tar.gz or built via `make WHAT=test/e2e/e2e.test`), and invoke:
    38  
    39      ginkgo -p -focus='External.Storage.*hostpath.csi.k8s.io' \
    40             -skip='\[Feature:|\[Disruptive\]' \
    41             e2e.test \
    42             -- \
    43             -storage.testdriver=/tmp/hostpath-testdriver.yaml
    44  
    45  This disables tests which depend on optional features. Those tests
    46  must be run by selecting them explicitly in an environment that
    47  supports them, for example snapshotting:
    48  
    49      ginkgo -p -focus='External.Storage.*hostpath.csi.k8s.io.*\[Feature:VolumeSnapshotDataSource\]' \
    50             -skip='\[Disruptive\]' \
    51             e2e.test \
    52             -- \
    53             -storage.testdriver=/tmp/hostpath-testdriver.yaml