Esempio n. 1
0
    def test_install2_enterprise(self):
        """ ################################### TEST INSTALLATION v2 ENTERPRISE
        """
        options = {
            'debug': True,
            'no-repos': False,
            'nginx': True,
        }

        base_dir = '/odoo_ar/'
        oe = OdooEnv(options)
        cmds = oe.install('test2e_client')
        self.assertEqual(cmds[0].args, base_dir)
        self.assertEqual(cmds[0].command, 'sudo mkdir ' + base_dir)
        self.assertEqual(cmds[0].usr_msg, 'Installing client test2e_client')

        self.assertEqual(
            cmds[2].args,
            '{}odoo-9.0e/test2e_client/postgresql'.format(base_dir))
        self.assertEqual(
            cmds[2].command,
            'mkdir -p {}odoo-9.0e/test2e_client/postgresql'.format(base_dir))
        self.assertEqual(cmds[2].usr_msg, False)

        self.assertEqual(cmds[8].args, '/odoo_ar/odoo-9.0e/dist-packages')
        self.assertEqual(cmds[8].command,
                         'mkdir -p /odoo_ar/odoo-9.0e/dist-packages')
        self.assertEqual(cmds[8].usr_msg, False)
Esempio n. 2
0
    def test_download_image_sources(self):
        """ ####################################### TEST DOWNLOAD IMAGE SOURCES
        """
        options = {
            'debug': True,
            'no-repos': False,
            'nginx': False,
        }
        oe = OdooEnv(options)
        cmds = oe.install('test_client')

        command = 'sudo mkdir /odoo_ar/'
        self.assertEqual(cmds[0].command, command)

        #command = 'sudo chown jobiols:jobiols /odoo_ar/'
        #self.assertEqual(cmds[1].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/postgresql'
        self.assertEqual(cmds[2].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/config'
        self.assertEqual(cmds[3].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/data_dir'
        self.assertEqual(cmds[4].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/backup_dir'
        self.assertEqual(cmds[5].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/log'
        self.assertEqual(cmds[6].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/test_client/sources'
        self.assertEqual(cmds[7].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/dist-packages'
        self.assertEqual(cmds[8].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/dist-local-packages'
        self.assertEqual(cmds[9].command, command)

        command = 'mkdir -p /odoo_ar/odoo-9.0/extra-addons'
        self.assertEqual(cmds[10].command, command)

        command = 'chmod og+w /odoo_ar/odoo-9.0/dist-packages'
        self.assertEqual(cmds[11].command, command)

        command = 'chmod og+w /odoo_ar/odoo-9.0/dist-local-packages'
        self.assertEqual(cmds[12].command, command)

        command = 'chmod og+w /odoo_ar/odoo-9.0/extra-addons'
        self.assertEqual(cmds[13].command, command)

        command = 'chmod o+w /odoo_ar/odoo-9.0/test_client/config'
        self.assertEqual(cmds[14].command, command)

        command = 'chmod o+w /odoo_ar/odoo-9.0/test_client/data_dir'
        self.assertEqual(cmds[15].command, command)

        command = 'chmod o+w /odoo_ar/odoo-9.0/test_client/log'
        self.assertEqual(cmds[16].command, command)

        command = 'chmod o+w /odoo_ar/odoo-9.0/test_client/backup_dir'
        self.assertEqual(cmds[17].command, command)

        command = 'sudo docker run -it --rm ' \
                  '--entrypoint=/extract_dist-packages.sh ' \
                  '-v /odoo_ar/odoo-9.0/dist-packages/:/mnt/dist-packages ' \
                  'jobiols/odoo-jeo:9.0.debug '
        self.assertEqual(cmds[18].command, command)

        command = 'sudo docker run -it --rm ' \
                  '--entrypoint=/extract_dist-local-packages.sh ' \
                  '-v /odoo_ar/odoo-9.0/dist-local-packages/:' \
                  '/mnt/dist-local-packages ' \
                  'jobiols/odoo-jeo:9.0.debug '
        self.assertEqual(cmds[19].command, command)

        command = 'sudo docker run -it --rm ' \
                  '--entrypoint=/extract_extra-addons.sh ' \
                  '-v /odoo_ar/odoo-9.0/extra-addons/:/mnt/extra-addons ' \
                  'jobiols/odoo-jeo:9.0.debug '
        self.assertEqual(cmds[20].command, command)

        command = 'sudo chmod -R og+w /odoo_ar/odoo-9.0/dist-packages/'
        self.assertEqual(cmds[21].command, command)

        command = 'sudo chmod -R og+w /odoo_ar/odoo-9.0/dist-local-packages/'
        self.assertEqual(cmds[22].command, command)

        command = 'sudo chmod -R og+w /odoo_ar/odoo-9.0/extra-addons/'
        self.assertEqual(cmds[23].command, command)

        command = '/odoo_ar/odoo-9.0/dist-packages/.gitignore'
        self.assertEqual(cmds[24].command, command)

        command = '/odoo_ar/odoo-9.0/dist-local-packages/.gitignore'
        self.assertEqual(cmds[25].command, command)

        command = '/odoo_ar/odoo-9.0/extra-addons/.gitignore'
        self.assertEqual(cmds[26].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-packages/ init '
        self.assertEqual(cmds[27].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-local-packages/ init '
        self.assertEqual(cmds[28].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/extra-addons/ init '
        self.assertEqual(cmds[29].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-packages/ add . '
        self.assertEqual(cmds[30].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-local-packages/ add . '
        self.assertEqual(cmds[31].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/extra-addons/ add . '
        self.assertEqual(cmds[32].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-packages/ commit -m inicial '
        self.assertEqual(cmds[33].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/dist-local-packages/ ' \
                  'commit -m inicial '
        self.assertEqual(cmds[34].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/extra-addons/ commit -m inicial '
        self.assertEqual(cmds[35].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/test_client/sources/ ' \
                  'clone --depth 1 -b 9.0 ' \
                  'https://github.com/jobiols/cl-test-client'
        self.assertEqual(cmds[36].command, command)

        command = 'git -C ' \
                  '/odoo_ar/odoo-9.0/test_client/sources/cl-test-client ' \
                  'pull'
        self.assertEqual(cmds[37].command, command)

        command = 'git -C /odoo_ar/odoo-9.0/test_client/sources/ ' \
                  'clone --depth 1 ' \
                  '-b 9.0 https://github.com/jobiols/odoo-addons'
        self.assertEqual(cmds[38].command, command)

        command = 'git -C ' \
                  '/odoo_ar/odoo-9.0/test_client/sources/odoo-addons ' \
                  'pull'
        self.assertEqual(cmds[39].command, command)
Esempio n. 3
0
    def test_install(self):
        """ ################################################# TEST INSTALLATION
        """
        options = {
            'debug': False,
            'no-repos': False,
            'nginx': True,
        }

        base_dir = '/odoo_ar/'
        oe = OdooEnv(options)
        cmds = oe.install('test_client')
        self.assertEqual(cmds[0].args, base_dir)
        self.assertEqual(cmds[0].command, 'sudo mkdir ' + base_dir)
        self.assertEqual(cmds[0].usr_msg, 'Installing client test_client')

        self.assertEqual(cmds[2].args,
                         '{}odoo-9.0/test_client/postgresql'.format(base_dir))
        self.assertEqual(
            cmds[2].command,
            'mkdir -p {}odoo-9.0/test_client/postgresql'.format(base_dir))
        self.assertEqual(cmds[2].usr_msg, False)

        self.assertEqual(cmds[3].args, '/odoo_ar/odoo-9.0/test_client/config')
        self.assertEqual(cmds[3].command,
                         'mkdir -p /odoo_ar/odoo-9.0/test_client/config')
        self.assertEqual(cmds[3].usr_msg, False)

        self.assertEqual(cmds[4].args,
                         '/odoo_ar/odoo-9.0/test_client/data_dir')
        self.assertEqual(cmds[4].command,
                         'mkdir -p /odoo_ar/odoo-9.0/test_client/data_dir')
        self.assertEqual(cmds[4].usr_msg, False)

        self.assertEqual(cmds[5].args,
                         '/odoo_ar/odoo-9.0/test_client/backup_dir')
        self.assertEqual(cmds[5].command,
                         'mkdir -p /odoo_ar/odoo-9.0/test_client/backup_dir')
        self.assertEqual(cmds[5].usr_msg, False)

        self.assertEqual(cmds[6].args, '/odoo_ar/odoo-9.0/test_client/log')
        self.assertEqual(cmds[6].command,
                         'mkdir -p /odoo_ar/odoo-9.0/test_client/log')
        self.assertEqual(cmds[6].usr_msg, False)

        self.assertEqual(cmds[7].args, '/odoo_ar/odoo-9.0/test_client/sources')
        self.assertEqual(cmds[7].command,
                         'mkdir -p /odoo_ar/odoo-9.0/test_client/sources')
        self.assertEqual(cmds[7].usr_msg, False)

        self.assertEqual(cmds[8].args, False)
        self.assertEqual(cmds[8].command,
                         'chmod o+w /odoo_ar/odoo-9.0/test_client/config')
        self.assertEqual(cmds[8].usr_msg, False)

        self.assertEqual(cmds[9].args, False)
        self.assertEqual(cmds[9].command,
                         'chmod o+w /odoo_ar/odoo-9.0/test_client/data_dir')
        self.assertEqual(cmds[9].usr_msg, False)

        self.assertEqual(cmds[10].args, False)
        self.assertEqual(cmds[10].command,
                         'chmod o+w /odoo_ar/odoo-9.0/test_client/log')
        self.assertEqual(cmds[10].usr_msg, False)

        self.assertEqual(cmds[11].args, False)
        self.assertEqual(cmds[11].command,
                         'chmod o+w /odoo_ar/odoo-9.0/test_client/backup_dir')
        self.assertEqual(cmds[11].usr_msg, False)

        self.assertEqual(cmds[12].args, '/odoo_ar/nginx/cert')
        self.assertEqual(cmds[12].command, 'mkdir -p /odoo_ar/nginx/cert')
        self.assertEqual(cmds[12].usr_msg, False)

        self.assertEqual(cmds[13].args, '/odoo_ar/nginx/conf')
        self.assertEqual(cmds[13].command, 'mkdir -p /odoo_ar/nginx/conf')
        self.assertEqual(cmds[13].usr_msg, False)

        self.assertEqual(cmds[14].args, '/odoo_ar/nginx/log')
        self.assertEqual(cmds[14].command, 'mkdir -p /odoo_ar/nginx/log')
        self.assertEqual(cmds[14].usr_msg, False)

        self.assertEqual(cmds[15].args, '/odoo_ar/nginx/conf/nginx.conf')
        self.assertEqual(cmds[15].command, '/odoo_ar/nginx/conf/nginx.conf')
        self.assertEqual(cmds[15].usr_msg, 'Generating nginx.conf template')

        self.assertEqual(
            cmds[16].args,
            '/odoo_ar/odoo-9.0/test_client/sources/cl-test-client')
        self.assertEqual(
            cmds[16].command,
            'git -C /odoo_ar/odoo-9.0/test_client/sources/ clone --depth 1 '
            '-b 9.0 https://github.com/jobiols/cl-test-client')
        self.assertEqual(cmds[16].usr_msg,
                         'cloning b 9.0     jobiols/cl-test-client        ')

        self.assertEqual(
            cmds[17].args,
            '/odoo_ar/odoo-9.0/test_client/sources/cl-test-client')
        self.assertEqual(
            cmds[17].command,
            'git -C /odoo_ar/odoo-9.0/test_client/sources/cl-test-client pull')
        self.assertEqual(cmds[17].usr_msg,
                         'pulling b 9.0     jobiols/cl-test-client        ')

        self.assertEqual(cmds[18].args,
                         '/odoo_ar/odoo-9.0/test_client/sources/odoo-addons')
        self.assertEqual(
            cmds[18].command,
            'git -C /odoo_ar/odoo-9.0/test_client/sources/ clone --depth 1 '
            '-b 9.0 https://github.com/jobiols/odoo-addons')
        self.assertEqual(cmds[18].usr_msg,
                         'cloning b 9.0     jobiols/odoo-addons           ')

        self.assertEqual(cmds[19].args,
                         '/odoo_ar/odoo-9.0/test_client/sources/odoo-addons')
        self.assertEqual(
            cmds[19].command,
            'git -C /odoo_ar/odoo-9.0/test_client/sources/odoo-addons pull')
        self.assertEqual(cmds[19].usr_msg,
                         'pulling b 9.0     jobiols/odoo-addons           ')