znt/module/zanode/test/model/restoresnapshot.php

30 lines
1.2 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
declare(strict_types=1);
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$zanodeTest = new zanodeModelTest();
/**
title=测试 zanodeModel::restoreSnapshot();
timeout=0
cid=0
- 步骤1快照状态为completedHTTP连接失败 @failed
- 步骤2快照状态为restoring正在还原中 @快照正在还原中
- 步骤3快照状态为creating不可用 @快照不可用
- 步骤4快照状态为running不可用 @快照不可用
- 步骤5快照状态为failed不可用 @快照不可用
*/
r($zanodeTest->restoreSnapshotTest(2, 1)) && p() && e('failed'); // 步骤1快照状态为completedHTTP连接失败
r($zanodeTest->restoreSnapshotTest(2, 2)) && p() && e('快照正在还原中'); // 步骤2快照状态为restoring正在还原中
r($zanodeTest->restoreSnapshotTest(2, 3)) && p() && e('快照不可用'); // 步骤3快照状态为creating不可用
r($zanodeTest->restoreSnapshotTest(2, 4)) && p() && e('快照不可用'); // 步骤4快照状态为running不可用
r($zanodeTest->restoreSnapshotTest(2, 5)) && p() && e('快照不可用'); // 步骤5快照状态为failed不可用