Example #1
0
    def test_build_prefix_path(self):
        ttracker = trailtracker.TrailTracker(self.profile_name,
                                             self.bucket_name)
        self.failUnless(ttracker.s3_helper.valid is True)

        myargs = {}

        myargs['days'] = [2, 3, 4]

        prefix_paths = ttracker.build_prefix_paths(**myargs)
        self.failUnless(len(prefix_paths) > 0)
        print "Total prefix paths: ", len(prefix_paths)
Example #2
0
    def test_list_trail_archives(self):
        ttracker = trailtracker.TrailTracker(self.profile_name,
                                             self.bucket_name)
        self.failUnless(ttracker.s3_helper.valid is True)

        myargs = {}
        myargs['accountname'] = "cpedevtest"
        myargs['region'] = "us-east-1"
        myargs['year'] = 2016
        myargs['months'] = [12]
        myargs['days'] = [29]

        prefix_paths = ttracker.list_trail_archives(**myargs)
        self.failUnless(len(prefix_paths) > 0)
        print "Total trail archives: ", len(prefix_paths)
Example #3
0
    def test_search_trail_archives(self):
        ttracker = trailtracker.TrailTracker(self.profile_name,
                                             self.bucket_name)
        self.failUnless(ttracker.s3_helper.valid is True)

        myargs = {}
        myargs['accountname'] = "cpedevtest"
        myargs['region'] = "us-east-1"
        myargs['year'] = 2016
        myargs['months'] = [12]
        myargs['days'] = [29]

        myvar = {}
        myvar['test'] = "testvar"
        myargs['custom_callback'] = self.listener_callback
        myargs['custom_callback_args'] = myvar

        search_args = {}
        search_args['eventName'] = "RunInstance"
        myargs['search_args'] = search_args
        ttracker.search_trail_archives(**myargs)
Example #4
0
def start_trail_search(myargs):
    profile_name = os.environ.get('TT_PROFILE_NAME', None)
    bucket_name = os.environ.get('TT_BUCKET_NAME', None)
    ttracker = trailtracker.TrailTracker(profile_name, bucket_name)

    ttracker.search_trail_archives(**myargs)
Example #5
0
 def test_trail_tracker_init(self):
     ttracker = trailtracker.TrailTracker(self.profile_name,
                                          self.bucket_name)
     self.failUnless(ttracker.s3_helper.valid is True)