summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/cloud_tests/testcases/modules/snappy.yaml3
-rw-r--r--tests/cloud_tests/testcases/modules/write_files.py7
-rw-r--r--tests/cloud_tests/testcases/modules/write_files.yaml15
3 files changed, 19 insertions, 6 deletions
diff --git a/tests/cloud_tests/testcases/modules/snappy.yaml b/tests/cloud_tests/testcases/modules/snappy.yaml
index 43f93295..8ac322ae 100644
--- a/tests/cloud_tests/testcases/modules/snappy.yaml
+++ b/tests/cloud_tests/testcases/modules/snappy.yaml
@@ -1,6 +1,9 @@
#
# Install snappy
#
+# Aug 17, 2018: Disabled due to requiring a proxy for testing
+# tests do not handle the proxy well at this time.
+enabled: False
required_features:
- snap
cloud_config: |
diff --git a/tests/cloud_tests/testcases/modules/write_files.py b/tests/cloud_tests/testcases/modules/write_files.py
index 7bd520f6..526a2ebd 100644
--- a/tests/cloud_tests/testcases/modules/write_files.py
+++ b/tests/cloud_tests/testcases/modules/write_files.py
@@ -14,8 +14,11 @@ class TestWriteFiles(base.CloudTestCase):
def test_binary(self):
"""Test binary file reads as executable."""
- out = self.get_data_file('file_binary')
- self.assertIn('ELF 64-bit LSB executable, x86-64, version 1', out)
+ out = self.get_data_file('file_binary').strip()
+ md5 = "3801184b97bb8c6e63fa0e1eae2920d7"
+ sha256 = ("2c791c4037ea5bd7e928d6a87380f8ba7a803cd83d"
+ "5e4f269e28f5090f0f2c9a")
+ self.assertIn(out, (md5 + " -", sha256 + " -"))
def test_gzip(self):
"""Test gzip file shows up as a shell script."""
diff --git a/tests/cloud_tests/testcases/modules/write_files.yaml b/tests/cloud_tests/testcases/modules/write_files.yaml
index ce936b7b..cc7ea4bd 100644
--- a/tests/cloud_tests/testcases/modules/write_files.yaml
+++ b/tests/cloud_tests/testcases/modules/write_files.yaml
@@ -3,6 +3,13 @@
#
# NOTE: on trusty 'file' has an output formatting error for binary files and
# has 2 spaces in 'LSB executable', which causes a failure here
+#
+# NOTE: the binary data can be any binary data, not only executables
+# and can be generated via the base 64 command as such:
+# $ base64 < hello > hello.txt
+# the opposite is running:
+# $ base64 -d < hello.txt > hello
+#
required_features:
- no_file_fmt_e
cloud_config: |
@@ -19,9 +26,7 @@ cloud_config: |
SMBDOPTIONS="-D"
path: /root/file_text
- content: !!binary |
- f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAAAAAAAAAEAAOAAI
- AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAADAAQAAAAAAAAgA
- AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAABwAAAAAAAAAAQAA
+ /Z/xrHR4WINT0UNoKPQKbuovp6+Js+JK
path: /root/file_binary
permissions: '0555'
- encoding: gzip
@@ -38,7 +43,9 @@ collect_scripts:
file /root/file_text
file_binary: |
#!/bin/bash
- file /root/file_binary
+ for hasher in md5sum sha256sum; do
+ $hasher </root/file_binary && break
+ done
file_gzip: |
#!/bin/bash
file /root/file_gzip