[tor-commits] [stem/master] Skipping integ test on cached descriptors if not available

atagar at torproject.org atagar at torproject.org
Mon Mar 26 00:10:01 UTC 2012


commit e1f7537e939a60e7c902e853b03daab9c28b3d33
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Mar 25 12:20:43 2012 -0700

    Skipping integ test on cached descriptors if not available
    
    The first time we run our integration tests our data directory is not yet fully
    populated. This causes our test that runs over the cached descriptor file to
    fail. Adding a check that the cached descriptors exist before running it.
---
 test/integ/descriptor/server_descriptor.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/test/integ/descriptor/server_descriptor.py b/test/integ/descriptor/server_descriptor.py
index 3782dea..f950c4a 100644
--- a/test/integ/descriptor/server_descriptor.py
+++ b/test/integ/descriptor/server_descriptor.py
@@ -98,6 +98,13 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4=
     additions.
     """
     
+    descriptor_path = os.path.join(test.runner.get_runner().get_test_dir(), "cached-descriptors")
+    
+    # if this is our first time running the integ tests and we didn't wait for
+    # a full tor initialization then the cached descriptors won't exist yet
+    if not os.path.exists(descriptor_path):
+      self.skipTest("(no cached descriptors)")
+    
     global RAN_CACHED_DESCRIPTOR_TEST
     
     if RAN_CACHED_DESCRIPTOR_TEST:
@@ -105,8 +112,6 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4=
     else:
       RAN_CACHED_DESCRIPTOR_TEST = True
     
-    descriptor_path = os.path.join(test.runner.get_runner().get_test_dir(), "cached-descriptors")
-    
     with open(descriptor_path) as descriptor_file:
       for desc in stem.descriptor.server_descriptor.parse_file_v3(descriptor_file):
         # the following attributes should be deprecated, and not appear in the wild





More information about the tor-commits mailing list