GetNamedDataStore returns a named datastore from the TestBucket. Each number (starting from 0, indicates which data store you'll get.
(count int)
| 119 | |
| 120 | // GetNamedDataStore returns a named datastore from the TestBucket. Each number (starting from 0, indicates which data store you'll get. |
| 121 | func (tb *TestBucket) GetNamedDataStore(count int) (DataStore, error) { |
| 122 | dataStoreNames := tb.GetNonDefaultDatastoreNames() |
| 123 | if len(dataStoreNames) == 0 { |
| 124 | tb.t.Fatalf("You are requesting a named datastore on TestBucket that has none.") |
| 125 | } |
| 126 | if count > len(dataStoreNames) { |
| 127 | tb.t.Fatalf("You are requesting more datastores %d than are available on this test instance %d", count, len(dataStoreNames)) |
| 128 | } |
| 129 | return tb.Bucket.NamedDataStore(dataStoreNames[count]) |
| 130 | } |
| 131 | |
| 132 | // Return a sorted list of data store names |
| 133 | func (tb *TestBucket) GetNonDefaultDatastoreNames() []sgbucket.DataStoreName { |