'Record a summary test result.
:param status_code: status code string, see
shared.log.is_valid_status()
:param test_name: name of the test
:param reason: (optional) string providing detailed reason for test
outcome
:param attributes: (optional) dict of string keyvals to associate with
this result
:param distinguishing_attributes: (optional) list of attribute names
that should be used to distinguish identically-named test
results.  These attributes should be present in the attributes
parameter.  This is used to generate user-friendly subdirectory
names.
:param child_test_ids: (optional) list of test indices for test results
used in generating this result.'

def record_summary(self, status_code, test_name, reason='', attributes=None, distinguishing_attributes=(), child_test_ids=None):

    subdirectory_name_parts = [test_name]
    for attribute in distinguishing_attributes:
        assert attributes
        assert (attribute in attributes), ('%s    not    in    %s' % (attribute, attributes))
        subdirectory_name_parts.append(attributes[attribute])
    base_subdirectory_name = '.'.join(subdirectory_name_parts)
    subdirectory = self._unique_subdirectory(base_subdirectory_name)
    subdirectory_path = os.path.join(self.resultdir, subdirectory)
    os.mkdir(subdirectory_path)
    self.record(status_code, subdirectory, test_name, status=reason, optional_fields={'is_summary': True})
    if attributes:
        utils.write_keyval(subdirectory_path, attributes)
    if child_test_ids:
        ids_string = ','.join((str(test_id) for test_id in child_test_ids))
        summary_data = {'child_test_ids': ids_string}
        utils.write_keyval(os.path.join(subdirectory_path, 'summary_data'), summary_data)
