Feature: Snapshots

  Background:
    * Make sure that gnome-boxes is running
    * Wait until overview is loaded

  @snapshots_create_an_revert
  Scenario: Create snapshots and revert to them
    * Create new box "Core-5"
    * Create snapshot "working network" from machine "Core-5"
    * Go into "Core-5" box
    * Wait for "sleep 1" end
    * Type "sudo ifconfig eth0 down"
    * Press "back" in "Core-5" vm
    * Wait for "sleep 5" end
    * Create snapshot "network down" from machine "Core-5"
    When "network down" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Cannot ping "Core-5"
    * Revert machine "Core-5" to state "working network"
    When "working network" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Ping "Core-5"
    * Revert machine "Core-5" to state "network down"
    Then Cannot ping "Core-5"

  @delete_snapshots
  Scenario: Delete snapshots
    * Initiate new box "Core-5" installation
    * Create snapshot "working network" from machine "Core-5"
    * Create snapshot "network down" from machine "Core-5"
    * Delete machines "Core-5" snapshot "working network"
    * Delete machines "Core-5" snapshot "network down"
    Then "error: domain 'boxes-unknown' has no current snapshot" is visible with command "virsh snapshot-current boxes-unknown"

Feature: Snapshots

  Background:
    * Make sure that gnome-boxes is running
    * Wait until overview is loaded

  @snapshots_create_an_revert
  Scenario: Create snapshots and revert to them
    * Create new box "Core-5"
    * Create snapshot "working network" from machine "Core-5"
    * Go into "Core-5" box
    * Wait for "sleep 1" end
    * Type "sudo ifconfig eth0 down"
    * Press "back" in "Core-5" vm
    * Wait for "sleep 5" end
    * Create snapshot "network down" from machine "Core-5"
    When "network down" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Cannot ping "Core-5"
    * Revert machine "Core-5" to state "working network"
    * Wait for "sleep 5" end
    When "working network" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Ping "Core-5"
    * Revert machine "Core-5" to state "network down"
    * Wait for "sleep 5" end
    Then Cannot ping "Core-5"

  @delete_snapshots
  Scenario: Delete snapshots
    * Initiate new box "Core-5" installation
    * Create snapshot "working network" from machine "Core-5"
    * Create snapshot "network down" from machine "Core-5"
    * Delete machines "Core-5" snapshot "working network"
    * Delete machines "Core-5" snapshot "network down"
    Then "error: domain 'boxes-unknown' has no current snapshot" is visible with command "virsh snapshot-current boxes-unknown"

Add 5 seconds sleep after snapshot revert
tests: Add 5 seconds sleep after snapshot revert

Time it takes to revert VMs to snapshots varies a lot so lets wait at
least 5 seconds before checking for the process to have finished.

https://bugzilla.gnome.org/show_bug.cgi?id=744703
