testRandomObjects returns a slice of randomly generated objects. If it is called with an object count of < 0 a random number of slices (with an upper bound of 100) will be generated.
(num int)
| 352 | // testRandomObjects returns a slice of randomly generated objects. If it is called with an object |
| 353 | // count of < 0 a random number of slices (with an upper bound of 100) will be generated. |
| 354 | func testRandomObjects(num int) (objects []deploy.KubeObject) { |
| 355 | if num < 0 { |
| 356 | num = rand.Intn(100) |
| 357 | } |
| 358 | |
| 359 | for i := 0; i < num; i++ { |
| 360 | // TODO: create different types of objects |
| 361 | name := "" |
| 362 | for { |
| 363 | name = randomString(10) |
| 364 | if !TestUsedNames[name] { |
| 365 | break |
| 366 | } |
| 367 | } |
| 368 | TestUsedNames[name] = true |
| 369 | objects = append(objects, createSecret(name)) |
| 370 | } |
| 371 | return |
| 372 | } |
| 373 | |
| 374 | func randomString(strlen int) string { |
| 375 | const chars = "abcdefghijklmnopqrstuvwxyz0123456789" |
no test coverage detected