def test_default_install(self): """Install from scratch test case""" # only an amd64 framework if platform.machine() != "x86_64": return self.child = spawn_process(self.command('{} ide clion'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() logger.info("Installed, running...") # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", self.installed_path], wait_before=self.TIMEOUT_START) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} ide clion'.format(UMAKE))) self.expect_and_no_warn("CLion is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_beta_install(self): """Install Atom from scratch test case""" self.installed_path += '-beta' self.desktop_filename = self.desktop_filename.replace('.desktop', '-beta.desktop') self.command_args += ' --beta' self.name += ' Beta' self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn(r"Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn(r"Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # Test if the apm symlink is added correctly: self.assertTrue(self.is_in_path(os.path.join(self.install_base_path, 'bin', 'apm'))) # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["atom", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.communicate() proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn(r"{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install VSCodium from scratch test case""" self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn(r"Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn(r"Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["codium", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.communicate() proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn(r"{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_beta_install(self): """Install Atom from scratch test case""" self.installed_path += '-beta' self.desktop_filename = self.desktop_filename.replace('.desktop', '-beta.desktop') self.command_args += ' --beta' self.name += ' Beta' self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # Test if the apm symlink is added correctly: self.assertTrue(self.is_in_path(os.path.join(self.install_base_path, 'bin', 'apm'))) # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["atom", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_insiders_install(self): """Install visual studio insiders""" self.installed_path += '-insiders' self.desktop_filename = self.desktop_filename.replace('.desktop', '-insiders.desktop') self.command_args += ' --insiders' self.name += ' Insiders' self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("\[I Accept.*\]") # ensure we have a license question self.child.sendline("a") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process([os.path.join(self.installed_path, 'code-insiders')], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Visual Studio Code Insiders is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_eap_install(self): self.installed_path += '-eap' self.desktop_filename = self.desktop_filename.replace('.desktop', '-eap.desktop') self.command_args += ' --eap' self.name += ' EAP' self.child = spawn_process(self.command(self.command_args)) result = self.return_and_wait_expect([r"ERROR: No EAP version available.*\[.*\]", r"Choose installation path: {}".format(self.installed_path)]) if result == 1: self.child.sendline("") self.expect_and_no_warn(r"Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", self.installed_path], wait_before=self.TIMEOUT_START) proc.communicate() proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn(r"{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install STS from scratch test case""" self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) # on 64 bits, there is a java subprocess, we kill that one with SIGKILL (eclipse isn't reliable on SIGTERM) if self.arch_option == "x86_64": self.check_and_kill_process(["java", self.arch_option, self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) else: self.check_and_kill_process([self.exec_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install from scratch test case""" self.child = spawn_process(self.command('{} ide netbeans'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() logger.info("Installed, running...") # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", self.installed_path], wait_before=self.TIMEOUT_START) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} ide netbeans'.format(UMAKE))) self.expect_and_no_warn("Netbeans is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_install(self): self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process([self.exec_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Chromedriver is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close() self.assert_exec_exists()
def test_eap_install(self): self.installed_path += '-eap' self.desktop_filename.replace('.desktop', '-eap.desktop') self.command_args += ' --eap' self.name += ' EAP' self.child = spawn_process(self.command(self.command_args)) result = self.expect_and_no_warn(["ERROR: No EAP version available.*\[.*\]", "Choose installation path: {}".format(self.installed_path)]) if result == 1: self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(self.exec_path, wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install from scratch test case""" self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") result = self.return_and_wait_expect( ["ERROR: No Stable version available.", "Installation done"], timeout=self.TIMEOUT_INSTALL_PROGRESS) if result == 0: self.assertTrue(self.name == 'GogLand') elif result == 1: # we have an installed launcher, added to the launcher and an icon file self.assertTrue( self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", self.installed_path], wait_before=self.TIMEOUT_START) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("{} is already installed.*\[.*\] ".format( self.name)) self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install Arduino from scratch test case""" self.child = spawn_process( self.command('{} electronics arduino'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue( self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assertTrue(self.is_in_group("dialout")) self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", "processing.app.Base"], wait_before=self.TIMEOUT_START) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process( self.command('{} electronics arduino'.format(UMAKE))) self.expect_and_no_warn("Arduino is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install visual studio from scratch test case""" self.child = spawn_process(self.command('{} web visual-studio-code'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("\[I Accept.*\]") # ensure we have a license question self.child.sendline("a") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["Code", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} web visual-studio-code'.format(UMAKE))) self.expect_and_no_warn("Visual Studio Code is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_install(self): """Install from scratch test case""" self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") result = self.return_and_wait_expect(["ERROR: No Stable version available.", "Installation done"], timeout=self.TIMEOUT_INSTALL_PROGRESS) if result == 0: self.assertTrue(self.name == 'GoLand') elif result == 1: # we have an installed launcher, added to the launcher and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["java", self.installed_path], wait_before=self.TIMEOUT_START) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("{} is already installed.*\[.*\] ".format(self.name)) self.child.sendline() self.wait_and_close()
def test_default_scala_install(self): """Install Scala from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.scala") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = ["bash", "-l", "-c", "scala {}".format(example_file)] else: # our mock expects getting that path compile_command = ["bash", "-l", "scala /tmp/hello.scala"] self.child = spawn_process(self.command('{} scala'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) # compile a small project output = subprocess.check_output(self.command_as_list(compile_command)).decode() if self.in_container: self.assertEqual(output, "hello, world\r\n") else: self.assertEqual(output, "hello, world\n")
def test_lts_select_install(self): """Install nodejs lts""" self.child = spawn_process(self.command('{} nodejs --lts').format(UMAKE)) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close()
def verify_install(self, installed_language): # we have an installed launcher, added to the launcher, a dictionary file and an icon file self.assertTrue( self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assertTrue(self.language_file_exists(installed_language)) self.assert_exec_exists() self.assert_icon_exists() self.assert_exec_link_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["firefox-dev", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process( self.command('{} web firefox-dev'.format(UMAKE))) self.expect_and_no_warn("Firefox Dev is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_scala_install(self): """Install Scala from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.scala") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = [ "bash", "-l", "-c", "scala {}".format(example_file) ] else: # our mock expects getting that path compile_command = ["bash", "-l", "scala /tmp/hello.scala"] self.child = spawn_process(self.command('{} scala'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) # compile a small project output = subprocess.check_output(self.command_as_list(compile_command)).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "hello, world")
def test_default_swift_install(self): """Install Swift from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "Package.swift") open(example_file, "w").write("") os.mkdir(os.path.join(self.example_prog_dir, "Sources")) example_file = os.path.join(self.example_prog_dir, "Sources", "main.swift") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = ["bash", "-l", "-c", "swift build"] else: # our mock expects getting that command parameter self.example_prog_dir = "/tmp" compile_command = ["bash", "-l", "swift build"] self.child = spawn_process(self.command('{} swift'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) resulting_binary = os.path.join(self.example_prog_dir, ".build", "debug", self.example_prog_dir.split('/')[-1]) # compile a small project subprocess.check_call(self.command_as_list(compile_command), cwd=self.example_prog_dir) # run the compiled result output = subprocess.check_output(self.command(resulting_binary), cwd=self.example_prog_dir, shell=True).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "Hello, world!")
def test_default_dart_install(self): """Install dart editor from scratch test case""" self.child = spawn_process(self.command('{} dart'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} dart'.format(UMAKE))) self.expect_and_no_warn("Dart SDK is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_dart_install(self): """Install dart editor from scratch test case""" self.child = spawn_process(self.command('{} dart flutter-sdk'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() # we have an installed launcher, added to the launcher and an icon file self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} dart flutter-sdk'.format(UMAKE))) self.expect_and_no_warn("Flutter SDK is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_install(self): self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() # ensure that it's detected as installed: self.child = spawn_process(self.command(self.command_args)) self.expect_and_no_warn("Terraform is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close() self.assert_exec_exists()
def test_arg_language_select_install(self): """Install firefox dev with language selected by --lang""" install_language = "bg" self.child = spawn_process(self.command('{} web firefox-dev --lang={}'.format(UMAKE, install_language))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.verify_install(install_language)
def test_unavailable_language_select_install(self): """Installing Firefox-dev in unavailable language should be rejected""" install_language = "ABCdwXYZ" self.child = spawn_process(self.command('{} web firefox-dev --lang={}'.format(UMAKE, install_language))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.wait_and_close(expect_warn=True, exit_status=1) self.assertFalse(self.launcher_exists_and_is_pinned(self.desktop_filename))
def test_lts_select_install(self): """Install nodejs lts""" self.child = spawn_process( self.command('{} nodejs --lts').format(UMAKE)) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close()
def test_default_rust_install(self): """Install Rust from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.rs") open(example_file, "w").write(self.EXAMPLE_PROJECT) # rust compile in pwd by default, do not pollute ubuntu make source code compile_command = [ "bash", "-l", "-c", "rustc --out-dir {} {}".format(self.example_prog_dir, example_file) ] else: # our mock expects getting that path self.example_prog_dir = "/tmp" example_file = os.path.join(self.example_prog_dir, "hello.rs") # rust compile in pwd by default, do not pollute ubuntu make source code compile_command = [ "bash", "-l", "rustc --out-dir {} {}".format(self.example_prog_dir, example_file) ] resulting_binary = os.path.join(self.example_prog_dir, "hello") self.child = spawn_process(self.command('{} rust'.format(UMAKE))) self.expect_and_no_warn(r"Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn(r"Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) self.assertTrue( self.is_in_path( os.path.join(self.installed_path, "cargo", "bin", "cargo"))) cmd_list = ["echo $LD_LIBRARY_PATH"] if not self.in_container: relogging_command = ["bash", "-l", "-c"] relogging_command.extend(cmd_list) cmd_list = relogging_command self.assertIn( os.path.join(self.installed_path, "rustc", "lib"), subprocess.check_output(self.command_as_list(cmd_list)).decode( "utf-8").strip().split(":")) # compile a small project subprocess.check_call(self.command_as_list(compile_command)) # run the compiled result output = subprocess.check_output(self.command_as_list(resulting_binary)).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "hello, world")
def test_default_install(self): """Install firefox dev from scratch test case""" install_language = "en-US" self.child = spawn_process(self.command('{} web firefox-dev'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Choose language:") self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.verify_install(install_language)
def test_default_maven_install(self): """Install Maven from scratch test case""" self.child = spawn_process(self.command('{} maven'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path))
def test_default_java_install(self): """Install OpenJXF from scratch test case""" self.child = spawn_process(self.command('{} java'.format(UMAKE))) self.expect_and_no_warn(r"Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn(r"Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assertTrue(self.is_in_path(self.exec_path))
def test_default_nodejs_install(self): """Install Nodejs from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.js") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = [ "bash", "-l", "-c", "node {}".format(example_file) ] npm_command = ["bash", "-l", "-c", "npm config get prefix"] else: # our mock expects getting that path compile_command = ["bash", "-l", "node /tmp/hello.js"] npm_command = ["bash", "-l", "npm config get prefix"] self.child = spawn_process(self.command('{} nodejs'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) npm_path = os.path.join(self.installed_path, "bin", "npm") self.assertTrue(self.path_exists(npm_path)) self.assertTrue(self.is_in_path(npm_path)) # compile a small project output = subprocess.check_output(self.command_as_list(compile_command)).decode()\ .replace('\r', '').replace('\n', '') # set npm prefix npm_output = subprocess.check_output(self.command_as_list(npm_command)).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "Hello World") self.assertEqual( npm_output, "{}/.npm_modules".format( os.path.join("/", self.installed_path.split('/')[1], self.installed_path.split('/')[2])))
def test_default_rust_install(self): """Install Rust from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.rs") open(example_file, "w").write(self.EXAMPLE_PROJECT) # rust compile in pwd by default, do not pollute ubuntu make source code compile_command = ["bash", "-l", "-c", "rustc --out-dir {} {}".format(self.example_prog_dir, example_file)] else: # our mock expects getting that path self.example_prog_dir = "/tmp" example_file = os.path.join(self.example_prog_dir, "hello.rs") # rust compile in pwd by default, do not pollute ubuntu make source code compile_command = ["bash", "-l", "rustc --out-dir {} {}".format(self.example_prog_dir, example_file)] resulting_binary = os.path.join(self.example_prog_dir, "hello") self.child = spawn_process(self.command('{} rust'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) self.assertTrue(self.is_in_path(os.path.join(self.installed_path, "cargo", "bin", "cargo"))) cmd_list = ["echo $LD_LIBRARY_PATH"] if not self.in_container: relogging_command = ["bash", "-l", "-c"] relogging_command.extend(cmd_list) cmd_list = relogging_command self.assertIn(os.path.join(self.installed_path, "rustc", "lib"), subprocess.check_output(self.command_as_list(cmd_list)).decode("utf-8").strip().split(":")) # compile a small project subprocess.check_call(self.command_as_list(compile_command)) # run the compiled result output = subprocess.check_output(self.command_as_list(resulting_binary)).decode() if self.in_container: self.assertEqual(output, "hello, world\r\n") else: self.assertEqual(output, "hello, world\n")
def verify_install(self, installed_language): # we have an installed launcher, added to the launcher, a dictionary file and an icon file self.assertTrue(self.launcher_exists_and_is_pinned(self.desktop_filename)) self.assertTrue(self.language_file_exists(installed_language)) self.assert_exec_exists() self.assert_icon_exists() # launch it, send SIGTERM and check that it exits fine proc = subprocess.Popen(self.command_as_list(self.exec_path), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) self.check_and_kill_process(["firefox-dev", self.installed_path], wait_before=self.TIMEOUT_START, send_sigkill=True) proc.wait(self.TIMEOUT_STOP) # ensure that it's detected as installed: self.child = spawn_process(self.command('{} web firefox-dev'.format(UMAKE))) self.expect_and_no_warn("Firefox Dev is already installed.*\[.*\] ") self.child.sendline() self.wait_and_close()
def test_default_swift_install(self): """Install Swift from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "Package.swift") open(example_file, "w").write("") os.mkdir(os.path.join(self.example_prog_dir, "Sources")) example_file = os.path.join(self.example_prog_dir, "Sources", "main.swift") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = ["bash", "-l", "-c", "swift build"] else: # our mock expects getting that command parameter self.example_prog_dir = "/tmp" compile_command = ["bash", "-l", "swift build"] self.child = spawn_process(self.command('{} swift'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format( self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) resulting_binary = os.path.join(self.example_prog_dir, ".build", "debug", self.example_prog_dir.split('/')[-1]) # compile a small project subprocess.check_call(self.command_as_list(compile_command), cwd=self.example_prog_dir) # run the compiled result output = subprocess.check_output(self.command(resulting_binary), cwd=self.example_prog_dir, shell=True).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "Hello, world!")
def test_default_nodejs_install(self): """Install Nodejs from scratch test case""" if not self.in_container: self.example_prog_dir = tempfile.mkdtemp() self.additional_dirs.append(self.example_prog_dir) example_file = os.path.join(self.example_prog_dir, "hello.js") open(example_file, "w").write(self.EXAMPLE_PROJECT) compile_command = ["bash", "-l", "-c", "node {}".format(example_file)] npm_command = ["bash", "-l", "-c", "npm config get prefix"] else: # our mock expects getting that path compile_command = ["bash", "-l", "node /tmp/hello.js"] npm_command = ["bash", "-l", "npm config get prefix"] self.child = spawn_process(self.command('{} nodejs'.format(UMAKE))) self.expect_and_no_warn("Choose installation path: {}".format(self.installed_path)) self.child.sendline("") self.expect_and_no_warn("Installation done", timeout=self.TIMEOUT_INSTALL_PROGRESS) self.wait_and_close() self.assert_exec_exists() self.assertTrue(self.is_in_path(self.exec_path)) npm_path = os.path.join(self.installed_path, "bin", "npm") self.assertTrue(self.path_exists(npm_path)) self.assertTrue(self.is_in_path(npm_path)) # compile a small project output = subprocess.check_output(self.command_as_list(compile_command)).decode()\ .replace('\r', '').replace('\n', '') # set npm prefix npm_output = subprocess.check_output(self.command_as_list(npm_command)).decode()\ .replace('\r', '').replace('\n', '') self.assertEqual(output, "Hello World") self.assertEqual(npm_output, "{}/.node_modules".format(os.path.join("/", self.installed_path.split('/')[1], self.installed_path.split('/')[2])))