src/tests/api/t_altroot.py
changeset 3158 58c9c2c21e67
parent 2339 aa5954c06b9d
child 3194 185fd0ebde38
equal deleted inserted replaced
3157:cff81e68a46b 3158:58c9c2c21e67
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
    19 #
    19 #
    20 # CDDL HEADER END
    20 # CDDL HEADER END
    21 #
    21 #
    22 
    22 
    23 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    23 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
    24 
    24 
    25 import testutils
    25 import testutils
    26 if __name__ == "__main__":
    26 if __name__ == "__main__":
    27         testutils.setup_environment("../../../proto")
    27         testutils.setup_environment("../../../proto")
    28 import pkg5unittest
    28 import pkg5unittest
   124                         e_str = traceback.format_exc()
   124                         e_str = traceback.format_exc()
   125 
   125 
   126                 args = ", ".join([str(a) for a in args])
   126                 args = ", ".join([str(a) for a in args])
   127                 self.fail(
   127                 self.fail(
   128                     "altroot call didn't return OSError EREMOTE exception\n"
   128                     "altroot call didn't return OSError EREMOTE exception\n"
   129                     "call: %s(%s)\n"
   129                     "call: {0}({1})\n"
   130                     "exception: %s\n" %
   130                     "exception: {2}\n".format(
   131                     (func.__name__, args, e_str))
   131                     func.__name__, args, e_str))
   132 
   132 
   133         def test_ar_err_eremote(self):
   133         def test_ar_err_eremote(self):
   134                 """Verify that all altroot accessor functions return EREMOTE
   134                 """Verify that all altroot accessor functions return EREMOTE
   135                 if they traverse a path which contains a symlink that point
   135                 if they traverse a path which contains a symlink that point
   136                 somewhere outside the specified altroot namespace."""
   136                 somewhere outside the specified altroot namespace."""
   172                         return
   172                         return
   173 
   173 
   174                 args = ", ".join([str(a) for a in args])
   174                 args = ", ".join([str(a) for a in args])
   175                 self.fail(
   175                 self.fail(
   176                     "altroot call didn't return None\n"
   176                     "altroot call didn't return None\n"
   177                     "call: %s(%s)\n"
   177                     "call: {0}({1})\n"
   178                     "rv: %s\n" %
   178                     "rv: {0}\n".format(
   179                     (func.__name__, args, str(rv)))
   179                     func.__name__, args, str(rv)))
   180 
   180 
   181         def test_ar_err_img_prefix(self):
   181         def test_ar_err_img_prefix(self):
   182                 """Verify that ar_img_prefix() returns None if we have a
   182                 """Verify that ar_img_prefix() returns None if we have a
   183                 corrupt image.  image 2 has both user and root image
   183                 corrupt image.  image 2 has both user and root image
   184                 repositories.  image 3 is not an image, it's an empty
   184                 repositories.  image 3 is not an image, it's an empty