@@ -39,6 +39,77 @@ import (
39
39
"github.com/onsi/ginkgo"
40
40
)
41
41
42
+ // DriverDefinition needs to be filled in via a .yaml or .json
43
+ // file. Its methods then implement the TestDriver interface, using
44
+ // nothing but the information in this struct.
45
+ type driverDefinition struct {
46
+ // DriverInfo is the static information that the storage testsuite
47
+ // expects from a test driver. See test/e2e/storage/testsuites/testdriver.go
48
+ // for details. The only field with a non-zero default is the list of
49
+ // supported file systems (SupportedFsType): it is set so that tests using
50
+ // the default file system are enabled.
51
+ DriverInfo testsuites.DriverInfo
52
+
53
+ // StorageClass must be set to enable dynamic provisioning tests.
54
+ // The default is to not run those tests.
55
+ StorageClass struct {
56
+ // FromName set to true enables the usage of a storage
57
+ // class with DriverInfo.Name as provisioner and no
58
+ // parameters.
59
+ FromName bool
60
+
61
+ // FromFile is used only when FromName is false. It
62
+ // loads a storage class from the given .yaml or .json
63
+ // file. File names are resolved by the
64
+ // framework.testfiles package, which typically means
65
+ // that they can be absolute or relative to the test
66
+ // suite's --repo-root parameter.
67
+ //
68
+ // This can be used when the storage class is meant to have
69
+ // additional parameters.
70
+ FromFile string
71
+ }
72
+
73
+ // SnapshotClass must be set to enable snapshotting tests.
74
+ // The default is to not run those tests.
75
+ SnapshotClass struct {
76
+ // FromName set to true enables the usage of a
77
+ // snapshotter class with DriverInfo.Name as provisioner.
78
+ FromName bool
79
+
80
+ // TODO (?): load from file
81
+ }
82
+
83
+ // InlineVolumes defines one or more volumes for use as inline
84
+ // ephemeral volumes. At least one such volume has to be
85
+ // defined to enable testing of inline ephemeral volumes. If
86
+ // a test needs more volumes than defined, some of the defined
87
+ // volumes will be used multiple times.
88
+ //
89
+ // DriverInfo.Name is used as name of the driver in the inline volume.
90
+ InlineVolumes []struct {
91
+ // Attributes are passed as NodePublishVolumeReq.volume_context.
92
+ // Can be empty.
93
+ Attributes map [string ]string
94
+ // Shared defines whether the resulting volume is
95
+ // shared between different pods (i.e. changes made
96
+ // in one pod are visible in another)
97
+ Shared bool
98
+ // ReadOnly must be set to true if the driver does not
99
+ // support mounting as read/write.
100
+ ReadOnly bool
101
+ }
102
+
103
+ // SupportedSizeRange defines the desired size of dynamically
104
+ // provisioned volumes.
105
+ SupportedSizeRange volume.SizeRange
106
+
107
+ // ClientNodeName selects a specific node for scheduling test pods.
108
+ // Can be left empty. Most drivers should not need this and instead
109
+ // use topology to ensure that pods land on the right node(s).
110
+ ClientNodeName string
111
+ }
112
+
42
113
// List of testSuites to be executed for each external driver.
43
114
var csiTestSuites = []func () testsuites.TestSuite {
44
115
testsuites .InitEphemeralTestSuite ,
@@ -142,77 +213,6 @@ var _ testsuites.EphemeralTestDriver = &driverDefinition{}
142
213
// an implementation.
143
214
var _ runtime.Object = & driverDefinition {}
144
215
145
- // DriverDefinition needs to be filled in via a .yaml or .json
146
- // file. It's methods then implement the TestDriver interface, using
147
- // nothing but the information in this struct.
148
- type driverDefinition struct {
149
- // DriverInfo is the static information that the storage testsuite
150
- // expects from a test driver. See test/e2e/storage/testsuites/testdriver.go
151
- // for details. The only field with a non-zero default is the list of
152
- // supported file systems (SupportedFsType): it is set so that tests using
153
- // the default file system are enabled.
154
- DriverInfo testsuites.DriverInfo
155
-
156
- // StorageClass must be set to enable dynamic provisioning tests.
157
- // The default is to not run those tests.
158
- StorageClass struct {
159
- // FromName set to true enables the usage of a storage
160
- // class with DriverInfo.Name as provisioner and no
161
- // parameters.
162
- FromName bool
163
-
164
- // FromFile is used only when FromName is false. It
165
- // loads a storage class from the given .yaml or .json
166
- // file. File names are resolved by the
167
- // framework.testfiles package, which typically means
168
- // that they can be absolute or relative to the test
169
- // suite's --repo-root parameter.
170
- //
171
- // This can be used when the storage class is meant to have
172
- // additional parameters.
173
- FromFile string
174
- }
175
-
176
- // SnapshotClass must be set to enable snapshotting tests.
177
- // The default is to not run those tests.
178
- SnapshotClass struct {
179
- // FromName set to true enables the usage of a
180
- // snapshotter class with DriverInfo.Name as provisioner.
181
- FromName bool
182
-
183
- // TODO (?): load from file
184
- }
185
-
186
- // InlineVolumes defines one or more volumes for use as inline
187
- // ephemeral volumes. At least one such volume has to be
188
- // defined to enable testing of inline ephemeral volumes. If
189
- // a test needs more volumes than defined, some of the defined
190
- // volumes will be used multiple times.
191
- //
192
- // DriverInfo.Name is used as name of the driver in the inline volume.
193
- InlineVolumes []struct {
194
- // Attributes are passed as NodePublishVolumeReq.volume_context.
195
- // Can be empty.
196
- Attributes map [string ]string
197
- // Shared defines whether the resulting volume is
198
- // shared between different pods (i.e. changes made
199
- // in one pod are visible in another)
200
- Shared bool
201
- // ReadOnly must be set to true if the driver does not
202
- // support mounting as read/write.
203
- ReadOnly bool
204
- }
205
-
206
- // SupportedSizeRange defines the desired size of dynamically
207
- // provisioned volumes.
208
- SupportedSizeRange volume.SizeRange
209
-
210
- // ClientNodeName selects a specific node for scheduling test pods.
211
- // Can be left empty. Most drivers should not need this and instead
212
- // use topology to ensure that pods land on the right node(s).
213
- ClientNodeName string
214
- }
215
-
216
216
func (d * driverDefinition ) DeepCopyObject () runtime.Object {
217
217
return nil
218
218
}
0 commit comments