File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
from __future__ import print_function
18
18
import os
19
+ import re
19
20
import shutil
20
21
import subprocess
21
22
import sys
@@ -328,6 +329,20 @@ def test_vm_lifecycle(vm_dir):
328
329
os .unlink (f"{ VAGRANT_DIR } /Vagrantfile" )
329
330
330
331
332
+ def test_vm_resumecycle (vm_dir ):
333
+ """Test methods controlling the VM - up(), suspend(), resume()."""
334
+ v = vagrant .Vagrant (vm_dir )
335
+
336
+ v .up ()
337
+ assert v .RUNNING == v .status ()[0 ].state
338
+
339
+ v .suspend ()
340
+ assert v .SAVED == v .status ()[0 ].state
341
+
342
+ v .resume ()
343
+ assert v .RUNNING == v .status ()[0 ].state
344
+
345
+
331
346
def test_valid_config (vm_dir ):
332
347
v = vagrant .Vagrant (vm_dir )
333
348
v .up ()
@@ -688,6 +703,14 @@ def test_make_file_cm(test_dir):
688
703
assert read_fh .read () == "one\n two\n "
689
704
690
705
706
+ def test_vagrant_version ():
707
+ v = vagrant .Vagrant ()
708
+ VAGRANT_VERSION = v .version ()
709
+ sys .stdout .write (f"vagrant_version(): { VAGRANT_VERSION } \n " )
710
+ version_result = bool (re .match ("^[0-9.]+$" , VAGRANT_VERSION ))
711
+ assert version_result is True
712
+
713
+
691
714
def _execute_command_in_vm (v , command ):
692
715
"""
693
716
Run command via ssh on the test vagrant box. Returns a tuple of the
You can’t perform that action at this time.
0 commit comments