Skip to content

Commit

Permalink
Merge pull request #140 from XiaowenJiang/infrasim-3.0
Browse files Browse the repository at this point in the history
Add MD5 check in functional test
  • Loading branch information
Bryan Fu authored Nov 16, 2016
2 parents 116cc3a + 600f6ba commit d9eaa48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test/functional/test_configuration_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import yaml
import netifaces
import hashlib
from infrasim import model
from test import fixtures

Expand Down Expand Up @@ -129,9 +130,11 @@ def test_network_bridge_network(self):
assert True

def test_qemu_boot_from_disk_img(self):
MD5_CIRROS_IMG = "ee1eca47dc88f4879d8a229cc70a07c6"
test_img_file = "{}/cirros-0.3.4-x86_64-disk.img".\
format(os.environ['HOME'])
if os.path.exists(test_img_file) is False:
if os.path.exists(test_img_file) is False \
or hashlib.md5(open(test_img_file, "rb").read()).hexdigest() != MD5_CIRROS_IMG:
os.system("wget -c \
http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img \
-O {}".format(test_img_file))
Expand Down
7 changes: 5 additions & 2 deletions test/functional/test_ipmi_kcs_smbios.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import time
import yaml
import hashlib
from infrasim import model
import paramiko
from test import fixtures
Expand All @@ -31,15 +32,17 @@ class test_kcs(unittest.TestCase):

@classmethod
def setUpClass(self):
MD5_KCS_IMG = "cfdf7d855d2f69c67c6e16cc9b53f0da"
test_img_file = "{}/kcs.img".\
format(os.environ['HOME'])
if os.path.exists(test_img_file) is False:
if os.path.exists(test_img_file) is False or \
hashlib.md5(open(test_img_file, "rb").read()).hexdigest() != MD5_KCS_IMG:
os.system("wget -c \
https://github.com/InfraSIM/test/raw/master/image/kcs.img \
-O {}".format(test_img_file))

if os.path.exists(test_img_file) is False:
return
assert False

fake_config = fixtures.FakeConfig()
self.conf = fake_config.get_node_info()
Expand Down

0 comments on commit d9eaa48

Please sign in to comment.