src/tests/cli/t_pkg_image_create.py
changeset 2152 623da55258c6
parent 2144 2ac203b826ab
child 2158 5a688b5b92a3
equal deleted inserted replaced
2151:e04e45c5e7a2 2152:623da55258c6
   357                 self.pkgsend_bulk(self.rurl2, "open [email protected]\nclose")
   357                 self.pkgsend_bulk(self.rurl2, "open [email protected]\nclose")
   358 
   358 
   359                 # First, create a new image.
   359                 # First, create a new image.
   360                 self.pkg_image_create(self.rurl1, prefix="test1")
   360                 self.pkg_image_create(self.rurl1, prefix="test1")
   361 
   361 
       
   362                 # Create a 'repo' directory in image directory so that we
       
   363                 # can verify that it survives the various upgrades.
       
   364                 rpath = os.path.join(self.get_img_path(), "repo")
       
   365                 self.pkgrepo("create %s" % rpath)
       
   366 
       
   367                 # Create an 'ssl' directory in image directory so that we
       
   368                 # can verify that it survives the various upgrades.
       
   369                 sslpath = os.path.join(self.get_img_path(), "ssl")
       
   370                 sslfile = os.path.join(sslpath, "my.cert")
       
   371                 os.mkdir(sslpath)
       
   372                 open(sslfile, "wb").close()
       
   373 
   362                 # Add the second repository.
   374                 # Add the second repository.
   363                 self.pkg("set-publisher -O %s test2" % self.rurl2)
   375                 self.pkg("set-publisher -O %s test2" % self.rurl2)
   364 
   376 
   365                 # Next, install the packages.
   377                 # Next, install the packages.
   366                 self.pkg("install quux")
   378                 self.pkg("install quux")
   563 
   575 
   564                 # Verify an already updated image will cause update-format to
   576                 # Verify an already updated image will cause update-format to
   565                 # exit 4.
   577                 # exit 4.
   566                 self.pkg("update-format", exit=4)
   578                 self.pkg("update-format", exit=4)
   567 
   579 
       
   580                 # Finally, check that repository and ssl data still exists
       
   581                 # through all the upgrades.
       
   582                 self.assert_(os.path.exists(os.path.join(rpath,
       
   583                     "pkg5.repository")))
       
   584                 self.assert_(os.path.exists(sslfile))
       
   585 
   568         def test_9_bad_image_state(self):
   586         def test_9_bad_image_state(self):
   569                 """Verify that the pkg(1) command handles invalid image state
   587                 """Verify that the pkg(1) command handles invalid image state
   570                 gracefully."""
   588                 gracefully."""
   571 
   589 
   572                 # Publish a package.
   590                 # Publish a package.