Beispiel #1
0
 def add_modif_inst_result(self, result, to_create):
     inst = LucteriosInstance(result[0])
     inst.set_extra("LANGUAGE_CODE='%s'" % result[5])
     inst.set_appli(result[1])
     inst.set_module(result[2])
     inst.set_database(result[4])
     if to_create:
         inst.add()
     else:
         inst.modif()
     inst = LucteriosInstance(result[0])
     inst.set_extra(result[3])
     inst.security()
     self.refresh(result[0])
Beispiel #2
0
 def add_modif_inst_result(self, result, to_create):
     inst = LucteriosInstance(result[0])
     inst.set_extra("LANGUAGE_CODE=%s" % result[5])
     inst.set_appli(result[1])
     inst.set_module(result[2])
     inst.set_database(result[4])
     if to_create:
         inst.add()
     else:
         inst.modif()
     inst = LucteriosInstance(result[0])
     inst.set_extra(result[3])
     inst.security()
     self.refresh(result[0])
Beispiel #3
0
    def test_security(self):
        from django.contrib.auth import authenticate
        self.assertEqual([], self.luct_glo.listing())

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.add()
        self.assertEqual(["inst_g"], self.luct_glo.listing())

        self.assertEqual(
            ["0"],
            list(
                self.run_sqlite_cmd(
                    "inst_g",
                    "SELECT value FROM CORE_parameter WHERE name='CORE-connectmode';"
                )))
        self.assertEqual(
            authenticate(username='******', password='******').username, 'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("PASSWORD=abc123,MODE=2")
        inst.security()

        self.assertEqual([
            "Admin password change in 'inst_g'.",
            "Security mode change in 'inst_g'."
        ], inst.msg_list)
        self.assertEqual(
            ["2"],
            list(
                self.run_sqlite_cmd(
                    "inst_g",
                    "SELECT value FROM CORE_parameter WHERE name='CORE-connectmode';"
                )))
        self.assertEqual(authenticate(username='******', password='******'),
                         None)
        self.assertEqual(
            authenticate(username='******', password='******').username,
            'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("MODE=1,PASSWORD=abc,123;ABC=789,3333")
        inst.security()
        self.assertEqual(authenticate(username='******', password='******'),
                         None)
        self.assertEqual(authenticate(username='******', password='******'),
                         None)
        self.assertEqual(
            authenticate(username='******',
                         password='******').username, 'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("PASSWORD=ppooi=jjhg,fdd,MODE=0")
        inst.security()
        self.assertEqual(
            authenticate(username='******', password='******').username,
            'admin')
Beispiel #4
0
    def test_security(self):
        from django.contrib.auth import authenticate
        self.assertEqual([], self.luct_glo.listing())

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.add()
        self.assertEqual(["inst_g"], self.luct_glo.listing())

        self.assertEqual(["0"], list(self.run_sqlite_cmd(
            "inst_g", "SELECT value FROM CORE_parameter WHERE name='CORE-connectmode';")))
        self.assertEqual(
            authenticate(username='******', password='******').username, 'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("PASSWORD=abc123,MODE=2")
        inst.security()

        self.assertEqual(["Admin password change in 'inst_g'.",
                          "Security mode change in 'inst_g'."], inst.msg_list)
        self.assertEqual(["2"], list(self.run_sqlite_cmd(
            "inst_g", "SELECT value FROM CORE_parameter WHERE name='CORE-connectmode';")))
        self.assertEqual(
            authenticate(username='******', password='******'), None)
        self.assertEqual(
            authenticate(username='******', password='******').username, 'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("MODE=1,PASSWORD=abc,123;ABC=789,3333")
        inst.security()
        self.assertEqual(
            authenticate(username='******', password='******'), None)
        self.assertEqual(
            authenticate(username='******', password='******'), None)
        self.assertEqual(authenticate(
            username='******', password='******').username, 'admin')

        inst = LucteriosInstance("inst_g", self.path_dir)
        inst.set_extra("PASSWORD=ppooi=jjhg,fdd,MODE=0")
        inst.security()
        self.assertEqual(
            authenticate(username='******', password='******').username, 'admin')