Add getPoolId

This commit is contained in:
Varchar38
2015-07-24 10:45:35 +02:00
parent 1f842e4fe4
commit 5a5c35a1c9

View File

@@ -7,21 +7,27 @@ import expect from 'must'
import {getConfig, getMainConnection, waitObjectState} from './util'
import eventToPromise from 'event-to-promise'
import {find} from 'lodash'
// ===================================================================
describe('pool', function () {
let xo
let serverId
let poolId
let config
before(async function () {
this.timeout(10e3)
xo = await getMainConnection()
const config = await getConfig()
;[xo, config] = await Promise.all([
getMainConnection(),
getConfig()
])
serverId = await xo.call('server.add', config.xenServer1).catch(() => {})
await eventToPromise(xo.objects, 'finish')
poolId = '566b37f1-e7d1-2236-3366-9e5d358b5cda'
poolId = getPoolId()
})
// -------------------------------------------------------------------
@@ -32,6 +38,14 @@ describe('pool', function () {
})
})
// -----------------------------------------------------------------
function getPoolId () {
const pools = xo.objects.indexes.type.pool
const pool = find(pools, {name_label: config.pool.name_label})
return pool.id
}
// ===================================================================
describe('.set()', function () {