Code dedup in virt.libvirt.test_imagecache.test_verify_checksum_*

Moved shared image and flags values to setUp()

Moved common code to separate functions:
    -_write_file()
    -_check_body()

bp nova-tests-code-duplication

Change-Id: Ic87475075312cbe8c7d7d04c23d394e09b80779e
Merge "Code dedup in virt.libvirt.test_imagecache.test_verify_checksum_*"