src/tests/cli/t_pkg_install_basics.py
changeset 443 5ffa5b7dac9c
parent 432 578875da6e04
child 472 9cec1a1677e1
--- a/src/tests/cli/t_pkg_install_basics.py	Fri Aug 01 23:55:39 2008 -0700
+++ b/src/tests/cli/t_pkg_install_basics.py	Fri Aug 01 23:57:44 2008 -0700
@@ -28,7 +28,9 @@
 	testutils.setup_environment("../../../proto")
 
 import os
+import time
 import unittest
+from stat import *
 
 class TestPkgInstallBasics(testutils.SingleDepotTestCase):
 
@@ -39,8 +41,9 @@
         foo11 = """
             open [email protected],5.11-0
             add dir mode=0755 owner=root group=bin path=/lib
-            add file /tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
+            add file /tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1 timestamp="20080731T024051Z"
             close """
+        foo11_timestamp = 1217472051
 
         foo12 = """
             open [email protected],5.11-0
@@ -65,7 +68,7 @@
             open [email protected],5.11-0
             add depend type=require fmri=pkg:/[email protected]
             add dir mode=0755 owner=root group=bin path=/bin
-            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat
+            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat 
             close """
 
         baz10 = """
@@ -137,6 +140,18 @@
                 self.pkg("search blah", exit = 1)
                 self.pkg("search -r blah", exit = 1)
 
+                # check to make sure timestamp was set to correct value
+
+                libc_path = os.path.join(self.get_img_path(), "lib/libc.so.1")
+                stat = os.stat(libc_path)
+
+                assert (stat[ST_MTIME] == self.foo11_timestamp)
+
+                # check that verify finds changes
+                now = time.time()
+                os.utime(libc_path, (now, now))
+                self.pkg("verify", exit=1)
+
                 self.pkg("uninstall foo")
                 self.pkg("verify")
                 self.pkg("list -a")