On Fri, Jun 14, 2013 at 07:39:59PM +0800, Wenchao Xia wrote:
+ def createSnapshotInTransaction(self, snapshot_num):
+ actions = []
+ for i in range(0, len(self.expect)):
+ num = self.expect[i]['snapshots_name_counter']
+ for j in range(0, snapshot_num):
+ name = '%s_sn%d' % (self.expect[i]['device'], num)
+ num = num + 1
+ self.expect[i]['snapshots'].append(name)
+ actions.append({
+ 'type': 'blockdev-snapshot-internal-sync',
+ 'data': { 'device': self.expect[i]['device'],
+ 'name': name },
+ })
+ self.expect[i]['snapshots_name_counter'] = num
+ result = self.vm.qmp('transaction', actions = actions)
+ self.assert_qmp(result, 'return', {})
This tests the success case. Please also use the 'Abort' action to test
the error case.