Commits

M0E-lnx  committed daacbf0

Fixing DATESET tests

  • Participants
  • Parent commits a6a61bb

Comments (0)

Files changed (3)

File modules/support/vectorlinux/DATESET.py

 
     def _line_sets_value(self, line):
         """ Returns True if line is "localtime" or "UTC" """
-        return line.startswith("localtime") or line.startswith("UTC")
+        return line.startswith("localtime") or line.startswith("UTC") \
+            or line.startswith('LocalTime') or line.startswith('LOCALTIME')
 
     def get_value(self):
         """ Read self.descriptor and return the current setting """
             "utc",
             "localtime",
             "Utc",
-            "Localtime"), "Invalid hardware clock identifier"
+            "Localtime", 'LocalTime'), "Invalid hardware clock identifier"
         newdata = []
         with open(self.descriptor) as f:
             for line in f:

File modules/support/vectorlinux/tests/jailedtest.sh

 
 TEST=$1
 CURDIR=$(pwd)
-echo $CURDIR
+#echo $CURDIR
 cd ../../../../../
 CURDIR=$(pwd)
-echo $CURDIR
+#echo $CURDIR
 mkdir -p /dev/shm/CHROOT-RW /dev/shm/CHROOT
 cp -ar vasm /dev/shm/CHROOT-RW/ || exit 1
 mount -t aufs -o br=/dev/shm/CHROOT-RW=rw:/=ro,xino=/dev/shm/aufs.xino none /dev/shm/CHROOT

File modules/support/vectorlinux/tests/test_DATESET.py

         self.zone = DATESET.TimeZone()
         super(TimeZoneTest, self).setUp()
         self.zonesbase = "/usr/share/zoneinfo/"
-        self.tz = "US/Central"
+        self.tz = "US/Eastern"
 
     def test_setEmtyZone(self):
         self.assertRaises(AssertionError,
         return self.assertTrue(ret)
 
     def test_getzone(self):
+        # set the zone.
+        self.assertTrue(self.zone.set_zone(self.tz))
         zone = self.zone.get_zone()
         return self.assertEqual(zone, self.tz)
 
     def test_verify_with_filesystem(self):
+        # we must set it again
+        self.assertTrue(self.zone.set_zone(self.tz))
         rlink = os.readlink("/etc/localtime-copied-from")
         return self.assertEqual(rlink, os.path.join(self.zonesbase, self.tz))