Example #1
0
 def test_update_version(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd =  comm.PackTools + "crosswalk-app update 13.42.319.7"
     comm.update(self, updatecmd)
     comm.clear("org.xwalk.test")
 def test_update_version(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7"
     comm.update(self, updatecmd)
     comm.clear("org.xwalk.test")
Example #3
0
 def test_update_currentVersion(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd =  comm.PackTools + "crosswalk-app update 13.42.319.7"
     comm.update(self, updatecmd)
     newupdatecmd =  comm.PackTools + "crosswalk-app update 13.42.319.7"
     updatestatus = commands.getstatusoutput(newupdatecmd)
     self.assertIn("Using cached", updatestatus[1])
     comm.clear("org.xwalk.test")
 def test_update_lowerVersion(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd =  comm.PackTools + "crosswalk-app update 13.42.319.7"
     comm.update(self, updatecmd)
     newupdatecmd =  comm.PackTools + "crosswalk-app update 11.40.277.1"
     comm.update(self, newupdatecmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
 def test_update_currentVersion(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7"
     comm.update(self, updatecmd)
     newupdatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7"
     (return_update_code,
      update_output) = comm.getstatusoutput(newupdatecmd)
     comm.clear("org.xwalk.test")
     self.assertIn("Using cached", update_output[0])
Example #6
0
 def test_update_canary(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     updatecmd = comm.PackTools + "crosswalk-app update canary"
     currentVersion = comm.update(self, updatecmd)
     crosswalklist = urllib2.urlopen(
         'https://download.01.org/crosswalk/releases/crosswalk/android/canary/').read()
     fp = open('test', 'w')
     fp.write(crosswalklist)
     fp.close()
     line = commands.getstatusoutput(
         "cat test|sed -n  '/src\=\"\/icons\/folder.gif\"/=' |sed -n '$p'")[1].strip()
     cmd = "cat test |sed -n '%dp' |awk -F 'href=' '{print $2}' |awk -F '\"|/' '{print $2}'" % int(
         line)
     version = commands.getstatusoutput(cmd)[1]
     if not '.' in version:
         line = commands.getstatusoutput(
             "tac test|sed -n  '/src\=\"\/icons\/folder.gif\"/=' |sed -n '2p'")[1].strip()
         cmd = "tac test |sed -n '%dp' |awk -F 'href=' '{print $2}' |awk -F '\"|/' '{print $2}'" % int(
             line)
         version = commands.getstatusoutput(cmd)[1]
     commands.getstatusoutput("rm -rf test")
     comm.clear("org.xwalk.test")
     self.assertEquals(currentVersion, version)
 def test_setup_cache_dir(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     os.mkdir("cache")
     comm.create(self)
     os.environ["CROSSWALK_APP_TOOLS_CACHE_DIR"] = comm.XwalkPath + "cache"
     os.chdir('org.xwalk.test')
     updatecmd =  comm.PackTools + "crosswalk-app update 13.42.319.5"
     comm.update(self, updatecmd)
     namelist = os.listdir(os.getcwd())
     os.chdir(comm.XwalkPath + "cache")
     crosswalklist = os.listdir(os.getcwd())
     os.environ["CROSSWALK_APP_TOOLS_CACHE_DIR"] = comm.XwalkPath
     os.chdir(comm.XwalkPath)
     shutil.rmtree("cache")
     comm.clear("org.xwalk.test")
     self.assertNotIn("crosswalk-13.42.319.5.zip", namelist)
     self.assertIn("crosswalk-13.42.319.5.zip", crosswalklist)
 def test_setup_cache_dir(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     if os.path.exists("cache"):
         shutil.rmtree("cache")
     os.mkdir("cache")
     comm.create(self)
     os.environ["CROSSWALK_APP_TOOLS_CACHE_DIR"] = comm.XwalkPath + "cache"
     os.chdir('org.xwalk.test')
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.5"
     comm.update(self, updatecmd)
     namelist = os.listdir(os.getcwd())
     os.chdir(comm.XwalkPath + "cache")
     crosswalklist = os.listdir(os.getcwd())
     os.environ["CROSSWALK_APP_TOOLS_CACHE_DIR"] = comm.XwalkPath
     os.chdir(comm.XwalkPath)
     shutil.rmtree("cache")
     comm.clear("org.xwalk.test")
     self.assertNotIn("crosswalk-13.42.319.5.zip", namelist)
     self.assertIn("crosswalk-13.42.319.5.zip", crosswalklist)
 def test_update_channel_path(self):
     comm.setUp()
     comm.create(self)
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update stable " + comm.XwalkPath + "org.xwalk.test"
     currentVersion = comm.update(self, updatecmd)
     htmlDoc = urllib2.urlopen(
         'https://download.01.org/crosswalk/releases/crosswalk/android/stable/').read()
     soup = BeautifulSoup(htmlDoc)
     alist = soup.find_all('a')
     version = ''
     for  index in range(-1, -len(alist)-1, -1):
         aEle = alist[index]
         version = aEle['href'].strip('/')
         if re.search('[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*', version):
             break
     comm.clear("org.xwalk.test")
     self.assertEquals(currentVersion, version)
 def test_update_channel_path(self):
     comm.setUp()
     comm.create(self)
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update stable " + comm.XwalkPath + "org.xwalk.test"
     currentVersion = comm.update(self, updatecmd)
     htmlDoc = urllib2.urlopen(
         'https://download.01.org/crosswalk/releases/crosswalk/android/stable/'
     ).read()
     soup = BeautifulSoup(htmlDoc)
     alist = soup.find_all('a')
     version = ''
     for index in range(-1, -len(alist) - 1, -1):
         aEle = alist[index]
         version = aEle['href'].strip('/')
         if re.search('[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*', version):
             break
     comm.clear("org.xwalk.test")
     self.assertEquals(currentVersion, version)
 def test_update_stable(self):
     comm.setUp()
     comm.create(self)
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update stable org.xwalk.test --windows-crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk
     comm.update(self, updatecmd)
     comm.clear("org.xwalk.test")
 def test_update_version_path(self):
     comm.setUp()
     comm.create(self)
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7 " + comm.XwalkPath + "org.xwalk.test"
     comm.update(self, updatecmd)
     comm.clear("org.xwalk.test")
 def test_update_version_path(self):
     comm.setUp()
     comm.create(self)
     updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7 " + comm.XwalkPath + "org.xwalk.test"
     comm.update(self, updatecmd)
     comm.clear("org.xwalk.test")