Example #1
0
    def test_run_string_empty_key(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'string', testUtil.getFileContents(testPuppetFileWithPath), 0, 'puppet', '')
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'string', testUtil.getFileContents(testPuppetFileWithPath), 0, 'puppet', '')
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "DBus: file properties not expected")
Example #2
0
    def test_run_string_good_puppet_manifest(self):
        results = wrapper(qmf, 'string', testUtil.getFileContents(testPuppetFileWithPath), 0, 'puppet', testUtil.getRandomKey(5))
        self.assertTrue( results.get('status') == 'OK', "QMF: result: " + str(results.get('status')) + " != OK")
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, targetFilePerms, targetFileOwner, targetFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            results = wrapper(dbus, 'string', testUtil.getFileContents(testPuppetFileWithPath), 0, 'puppet', testUtil.getRandomKey(5))
            self.assertTrue( results == 'OK', "DBus: result: " + str(results) + " != OK")
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, targetFilePerms, targetFileOwner, targetFileGroup), "DBus: file properties not expected")
Example #3
0
 def test_run_string_empty_key(self):
     self.assertRaises(QmfAgentException, wrapper, 'string',
                       testUtil.getFileContents(testPuppetFileWithPath), 0,
                       'puppet', '')
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, origFilePerms,
                        origFileOwner, origFileGroup),
         "file properties not expected")
Example #4
0
    def test_run_string_non_schema(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'string',
                          testUtil.getFileContents(testPuppetFileWithPath), 0,
                          'schema', testUtil.getRandomKey(5))
        self.assertTrue(
            0 == checkFile(testPuppetFileWithPath, origFilePerms,
                           origFileOwner, origFileGroup),
            "QMF: file properties not expected")

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'string',
                              testUtil.getFileContents(testPuppetFileWithPath),
                              0, 'schema', testUtil.getRandomKey(5))
            self.assertTrue(
                0 == checkFile(testPuppetFileWithPath, origFilePerms,
                               origFileOwner, origFileGroup),
                "DBus: file properties not expected")
Example #5
0
 def test_run_string_good_puppet_manifest(self):
     results = wrapper('string',
                       testUtil.getFileContents(testPuppetFileWithPath), 0,
                       'puppet', testUtil.getRandomKey(5))
     self.assertTrue(
         results.get('status') == 'OK',
         "result: " + str(results.get('status')) + " != OK")
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, targetFilePerms,
                        targetFileOwner, targetFileGroup),
         "file properties not expected")
 def test_run_string_non_schema(self):
     self.assertRaises(QmfAgentException, wrapper, 'string', testUtil.getFileContents(testPuppetFileWithPath), 0, 'schema', testUtil.getRandomKey(5))
     self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "file properties not expected")