Example #1
0
    def test_is_configured_unknown_key(self):
        results = qmf.is_configured(testUtil.getRandomKey(5))
        self.assertTrue( results.get('status') == 'unknown', "QMF result: " + str(results.get('status')) + " != unknown")

        if testUtil.haveDBus:
            results = dbus.is_configured(testUtil.getRandomKey(5))
            self.assertTrue( str(results) == 'unknown', "DBus result: " + str(results) + " != unknown")
Example #2
0
    def test_run_uri_bad_puppet_manifest(self):
        resetTestFile(testPuppetFileWithPath, origFilePerms, origFileOwner,
                      origFileGroup, 'bad puppet script')
        results = qmf.run_uri(testPuppetFileUrl, 0, 'puppet',
                              testUtil.getRandomKey(5))
        self.assertTrue(
            results.get('status') == 'FAILED\n1',
            "QMF: result: " + str(results.get('status')) + " != FAILED\n1")
        self.assertTrue(
            0 == checkFile(testPuppetFileWithPath, origFilePerms,
                           origFileOwner, origFileGroup),
            "QMF: file properties not expected")

        if testUtil.haveDBus:
            resetTestFile(testPuppetFileWithPath, origFilePerms, origFileOwner,
                          origFileGroup, 'bad puppet script')
            results = dbus.run_uri(testPuppetFileUrl, 0, 'puppet',
                                   testUtil.getRandomKey(5))
            self.assertTrue(
                str(results) == 'FAILED\n1',
                "DBus: result: " + str(results) + " != FAILED\n1")
            self.assertTrue(
                0 == checkFile(testPuppetFileWithPath, origFilePerms,
                               origFileOwner, origFileGroup),
                "DBus: file properties not expected")
Example #3
0
    def test_set_uuid_new_Custom_lifetime(self):
        test_uuid = testUtil.getRandomKey(20)
        qmf.set_uuid('Custom', test_uuid)
        result = qmf.get_uuid('Custom').get('uuid')
        self.assertEqual(
            result, test_uuid, "QMF uuid value (" + result +
            ") not matching expected(" + test_uuid + ")")
        connection.reQuery()
        uuid_prop = qmf.props.get('custom_uuid')
        self.assertEqual(
            uuid_prop, test_uuid, "QMF uuid value (" + uuid_prop +
            ") not matching expected(" + test_uuid + ")")

        if testUtil.haveDBus:
            test_uuid = testUtil.getRandomKey(20)
            dbus.set_uuid('Custom', test_uuid)
            uuid = dbus.get_uuid('Custom')
            self.assertEqual(
                uuid, test_uuid, "DBus uuid value (" + uuid +
                ") not matching expected(" + test_uuid + ")")
            dbus.reQuery()
            uuid = str(dbus.get('custom_uuid'))
            self.assertEqual(
                uuid, test_uuid, "DBus uuid value (" + uuid +
                ") not matching expected(" + test_uuid + ")")
Example #4
0
    def test_run_string_bad_augeas(self):
        result = wrapper(qmf, 'string', 'bad augeas query', 0, 'augeas', testUtil.getRandomKey(5)).get('status')
        tokens = result.split('\n')
        self.assertEqual(tokens[0], 'FAILED', "QMF: result: %s != FAILED" % tokens[0])

        if testUtil.haveDBus:
            result = wrapper(dbus, 'string', 'bad augeas query', 0, 'augeas', testUtil.getRandomKey(5))
            tokens = result.split('\n')
            self.assertEqual(tokens[0], 'FAILED', "DBus: result: %s != FAILED" % tokens[0])
Example #5
0
    def test_run_uri_file_url_not_found(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri',
                          'file://' + testAugeasFile, 0, 'augeas',
                          testUtil.getRandomKey(5))

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri',
                              'file://' + testAugeasFile, 0, 'augeas',
                              testUtil.getRandomKey(5))
Example #6
0
    def test_run_string_bad_puppet_manifest(self):
        results = wrapper(qmf, 'string', 'bad puppet manifest', 0, 'puppet', testUtil.getRandomKey(5))
        self.assertTrue( results.get('status') == 'FAILED\n1', "QMF: result: " + str(results.get('status')) + " != FAILED\n1")
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            results = wrapper(dbus, 'string', 'bad puppet manifest', 0, 'puppet', testUtil.getRandomKey(5))
            self.assertTrue(str(results) == 'FAILED\n1', "DBus: result: " + str(results) + " != FAILED\n1")
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "DBus: file properties not expected")
Example #7
0
    def test_run_uri_http_url_not_found_augeas(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri',
                          testAugeasFileUrl + "_bad", 0, 'augeas',
                          testUtil.getRandomKey(5))

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri',
                              testAugeasFileUrl + "_bad", 0, 'augeas',
                              testUtil.getRandomKey(5))
Example #8
0
    def test_run_uri_good_url_puppet_manifest(self):
        results = wrapper(qmf, 'uri', testPuppetFileUrl, 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, 'uri', testPuppetFileUrl, 0, 'puppet', testUtil.getRandomKey(5))
            self.assertTrue(str(results) == 'OK', "DBus result: " + str(results) + " != OK")
            self.assertTrue(0 == checkFile(testPuppetFileWithPath, targetFilePerms, targetFileOwner, targetFileGroup), "DBus: file properties not expected")
Example #9
0
    def test_run_uri_bad_puppet_manifest(self):
        resetTestFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup, 'bad puppet script')
        results = qmf.run_uri(testPuppetFileUrl, 0, 'puppet', testUtil.getRandomKey(5))
        self.assertTrue( results.get('status') == 'FAILED\n1', "QMF: result: " + str(results.get('status')) + " != FAILED\n1")
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            resetTestFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup, 'bad puppet script')
            results = dbus.run_uri(testPuppetFileUrl, 0, 'puppet', testUtil.getRandomKey(5))
            self.assertTrue( str(results) == 'FAILED\n1', "DBus: result: " + str(results) + " != FAILED\n1")
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "DBus: file properties not expected")
Example #10
0
    def test_is_configured_unknown_key(self):
        results = qmf.is_configured(testUtil.getRandomKey(5))
        self.assertTrue(
            results.get('status') == 'unknown',
            "QMF result: " + str(results.get('status')) + " != unknown")

        if testUtil.haveDBus:
            results = dbus.is_configured(testUtil.getRandomKey(5))
            self.assertTrue(
                str(results) == 'unknown',
                "DBus result: " + str(results) + " != unknown")
Example #11
0
    def test_run_string_good_augeas(self):
        results = wrapper(qmf, 'string', augeasFileContents, 0, 'augeas', testUtil.getRandomKey(5)).get('status')
        tokens = results.split('\n')
        self.assertEqual(tokens[0], 'OK', "QMF: result: %s != OK" % tokens[0])
        self.assertTrue(tokens[1].startswith("%s = " % augeasQuery), "QMF: wrong format of result (%s)" % tokens[1])

        if testUtil.haveDBus:
            results = wrapper(dbus, 'string', augeasFileContents, 0, 'augeas', testUtil.getRandomKey(5))
            tokens = results.split('\n')
            self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
            self.assertTrue(tokens[1].startswith("%s = " % augeasQuery), "DBus: wrong format of result (%s)" % tokens[1])
Example #12
0
    def test_is_configured_known_key(self):
        key = testUtil.getRandomKey(5)
        wrapper(qmf, 'uri',testPuppetFileUrl, 0, 'puppet', key)
        results = qmf.is_configured(key)
        self.assertTrue( results.get('status') == 'OK', "QMF result: " + str(results.get('status')) + " != OK")

        if testUtil.haveDBus:
            key = testUtil.getRandomKey(5)
            wrapper(dbus, 'uri',testPuppetFileUrl, 0, 'puppet', key)
            results = dbus.is_configured(key)
            self.assertTrue(str(results) == 'OK', "DBus result: " + str(results) + " != OK")
Example #13
0
    def test_is_configured_failed_key(self):
        key = testUtil.getRandomKey(5)
        wrapper(qmf, 'string', "bad puppet manifest", 0, 'puppet', key)
        tokens = qmf.is_configured(key).get('status').split('\n')
        self.assertTrue(tokens[0] == 'FAILED', "QMF result: %s != FAILED" % tokens[0])

        if testUtil.haveDBus:
            key = testUtil.getRandomKey(5)
            wrapper(dbus, 'string', "bad puppet manifest", 0, 'puppet', key)
            tokens = dbus.is_configured(key).split('\n')
            self.assertTrue(tokens[0] == 'FAILED', "DBus result: %s != FAILED" % tokens[0])
Example #14
0
    def test_is_configured_failed_key(self):
        key = testUtil.getRandomKey(5)
        wrapper(qmf, 'string', "bad puppet manifest", 0, 'puppet', key)
        tokens = qmf.is_configured(key).get('status').split('\n')
        self.assertTrue(tokens[0] == 'FAILED',
                        "QMF result: %s != FAILED" % tokens[0])

        if testUtil.haveDBus:
            key = testUtil.getRandomKey(5)
            wrapper(dbus, 'string', "bad puppet manifest", 0, 'puppet', key)
            tokens = dbus.is_configured(key).split('\n')
            self.assertTrue(tokens[0] == 'FAILED',
                            "DBus result: %s != FAILED" % tokens[0])
Example #15
0
    def test_run_string_bad_augeas(self):
        result = wrapper(qmf, 'string', 'bad augeas query', 0, 'augeas',
                         testUtil.getRandomKey(5)).get('status')
        tokens = result.split('\n')
        self.assertEqual(tokens[0], 'FAILED',
                         "QMF: result: %s != FAILED" % tokens[0])

        if testUtil.haveDBus:
            result = wrapper(dbus, 'string', 'bad augeas query', 0, 'augeas',
                             testUtil.getRandomKey(5))
            tokens = result.split('\n')
            self.assertEqual(tokens[0], 'FAILED',
                             "DBus: result: %s != FAILED" % tokens[0])
Example #16
0
    def test_run_string_good_augeas(self):
        results = wrapper(qmf, 'string', augeasFileContents, 0, 'augeas',
                          testUtil.getRandomKey(5)).get('status')
        tokens = results.split('\n')
        self.assertEqual(tokens[0], 'OK', "QMF: result: %s != OK" % tokens[0])
        self.assertTrue(tokens[1].startswith("%s = " % augeasQuery),
                        "QMF: wrong format of result (%s)" % tokens[1])

        if testUtil.haveDBus:
            results = wrapper(dbus, 'string', augeasFileContents, 0, 'augeas',
                              testUtil.getRandomKey(5))
            tokens = results.split('\n')
            self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
            self.assertTrue(tokens[1].startswith("%s = " % augeasQuery),
                            "DBus: wrong format of result (%s)" % tokens[1])
Example #17
0
    def test_is_configured_known_key(self):
        key = testUtil.getRandomKey(5)
        wrapper(qmf, 'uri', testPuppetFileUrl, 0, 'puppet', key)
        results = qmf.is_configured(key)
        self.assertTrue(
            results.get('status') == 'OK',
            "QMF result: " + str(results.get('status')) + " != OK")

        if testUtil.haveDBus:
            key = testUtil.getRandomKey(5)
            wrapper(dbus, 'uri', testPuppetFileUrl, 0, 'puppet', key)
            results = dbus.is_configured(key)
            self.assertTrue(
                str(results) == 'OK',
                "DBus result: " + str(results) + " != OK")
Example #18
0
 def test_run_uri_non_schema(self):
     self.assertRaises(QmfAgentException, wrapper, 'uri', testPuppetFileUrl,
                       0, 'schema', testUtil.getRandomKey(5))
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, origFilePerms,
                        origFileOwner, origFileGroup),
         "file properties not expected")
Example #19
0
    def test_run_uri_good_file_augeas(self):
        results = wrapper(qmf, 'uri', 'file://' + testAugeasFileWithPath, 0,
                          'augeas', testUtil.getRandomKey(5)).get('status')
        tokens = results.split('\n')
        self.assertEqual(tokens[0], 'OK', "QMF: result: %s != OK" % tokens[0])
        self.assertTrue(tokens[1].startswith("%s = " % augeasQuery),
                        "QMF: wrong format of result (%s)" % tokens[1])

        if testUtil.haveDBus:
            results = wrapper(dbus, 'uri', 'file://' + testAugeasFileWithPath,
                              0, 'augeas', testUtil.getRandomKey(5))
            tokens = results.split('\n')
            self.assertEqual(tokens[0], 'OK',
                             "DBus: result: %s != OK" % tokens[0])
            self.assertTrue(tokens[1].startswith("%s = " % augeasQuery),
                            "DBus: wrong format of result (%s)" % tokens[1])
Example #20
0
 def test_is_configured_known_key(self):
     key = testUtil.getRandomKey(5)
     wrapper('uri', testPuppetFileUrl, 0, 'puppet', key)
     results = sysconfig.is_configured(key)
     self.assertTrue(
         results.get('status') == 'OK',
         "result: " + str(results.get('status')) + " != OK")
Example #21
0
    def test_set_uuid_Custom_lifetime(self):
        test_uuid = testUtil.getRandomKey(20)
        qmf.set_uuid('Custom', test_uuid)
        result = qmf.get_uuid('Custom')
        self.assertEqual(result.get('uuid'), test_uuid, "QMF uuid value ("+result.get('uuid')+") not matching expected("+test_uuid+")")
        connection.reQuery()
        self.assertEqual(qmf.props.get('custom_uuid'), test_uuid, "QMF uuid value ("+qmf.props.get('uuid')+") not matching expected("+test_uuid+")")

        if testUtil.haveDBus:
            test_uuid = testUtil.getRandomKey(20)
            dbus.set_uuid('Custom', test_uuid)
            uuid = dbus.get_uuid('Custom')
            self.assertEqual(uuid, test_uuid, "DBus uuid value ("+uuid+") not matching expected("+test_uuid+")")
            dbus.reQuery()
            uuid = str(dbus.get('custom_uuid'))
            self.assertEqual(uuid, test_uuid, "DBus uuid value ("+uuid+") not matching expected("+test_uuid+")")
Example #22
0
 def test_set_uuid_new_Custom_lifetime(self):
     test_uuid = testUtil.getRandomKey(20)
     host.set_uuid('Custom', test_uuid)
     result = host.get_uuid('Custom')
     self.assertEqual(result.get('uuid'), test_uuid, "uuid value not matching expected("+result.get('uuid')+")")
     connection.reQuery()
     self.assertEqual(connection.props.get('custom_uuid'), test_uuid, "property not matching set value")
Example #23
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 #24
0
 def test_run_uri_special_chars_in_key(self):
     self.assertRaises(QmfAgentException, wrapper, 'uri', testPuppetFileUrl,
                       0, 'puppet',
                       testUtil.getRandomKey(5) + "'s $$$")
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, origFilePerms,
                        origFileOwner, origFileGroup),
         "file properties not expected")
Example #25
0
 def test_run_uri_file_url_not_found(self):
     self.assertRaises(QmfAgentException, wrapper, 'uri',
                       'file://' + testPuppetFile, 0, 'puppet',
                       testUtil.getRandomKey(5))
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, origFilePerms,
                        origFileOwner, origFileGroup),
         "file properties not expected")
Example #26
0
    def test_run_uri_http_url_not_found_puppet(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri',
                          testPuppetFileUrl + "_bad", 0, 'puppet',
                          testUtil.getRandomKey(5))
        self.assertTrue(
            0 == checkFile(testPuppetFileWithPath, origFilePerms,
                           origFileOwner, origFileGroup),
            "QMF: file properties not expected")

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri',
                              testPuppetFileUrl + "_bad", 0, 'puppet',
                              testUtil.getRandomKey(5))
            self.assertTrue(
                0 == checkFile(testPuppetFileWithPath, origFilePerms,
                               origFileOwner, origFileGroup),
                "DBus: file properties not expected")
Example #27
0
 def test_run_string_bad_puppet_manifest(self):
     results = wrapper('string', 'bad puppet manifest', 0, 'puppet',
                       testUtil.getRandomKey(5))
     self.assertTrue(
         results.get('status') == 'FAILED\n1',
         "result: " + str(results.get('status')) + " != FAILED\n1")
     self.assertTrue(
         0 == checkFile(testPuppetFileWithPath, origFilePerms,
                        origFileOwner, origFileGroup),
         "file properties not expected")
Example #28
0
 def test_run_uri_good_file_puppet_manifest(self):
     results = wrapper('uri', 'file://' + 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")
Example #29
0
    def test_run_uri_good_file_augeas(self):
        results = wrapper(qmf, 'uri', 'file://'+testAugeasFileWithPath, 0, 'augeas', testUtil.getRandomKey(5)).get('status')
        tokens = results.split('\n')
        self.assertEqual(tokens[0], 'OK', "QMF: result: %s != OK" % tokens[0])
        self.assertTrue(tokens[1].startswith("%s = " % augeasQuery), "QMF: wrong format of result (%s)" % tokens[1])

        if testUtil.haveDBus:
            results = wrapper(dbus, 'uri', 'file://'+testAugeasFileWithPath, 0, 'augeas', testUtil.getRandomKey(5))
            tokens = results.split('\n')
            self.assertEqual(tokens[0], 'OK', "DBus: result: %s != OK" % tokens[0])
            self.assertTrue(tokens[1].startswith("%s = " % augeasQuery), "DBus: wrong format of result (%s)" % tokens[1])
Example #30
0
    def test_run_uri_good_url_puppet_manifest(self):
        results = wrapper(qmf, 'uri', testPuppetFileUrl, 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, 'uri', testPuppetFileUrl, 0, 'puppet',
                              testUtil.getRandomKey(5))
            self.assertTrue(
                str(results) == 'OK',
                "DBus result: " + str(results) + " != OK")
            self.assertTrue(
                0 == checkFile(testPuppetFileWithPath, targetFilePerms,
                               targetFileOwner, targetFileGroup),
                "DBus: file properties not expected")
 def test_run_uri_non_schema(self):
     self.assertRaises(QmfAgentException, wrapper, 'uri', testPuppetFileUrl, 0, 'schema', testUtil.getRandomKey(5))
     self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "file properties not expected")
 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_uri_good_file_augeas(self):
     results = wrapper('uri', 'file://'+testAugeasFileWithPath, 0, 'augeas', testUtil.getRandomKey(5)).get('status')
     tokens = results.split('\n')
     self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
     self.assertTrue(tokens[1].startswith("%s = " % augeasQuery))
 def test_run_string_good_augeas(self):
     results = wrapper('string', augeasFileContents, 0, 'augeas', testUtil.getRandomKey(5)).get('status')
     tokens = results.split('\n')
     self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
     self.assertTrue(tokens[1].startswith("%s = " % augeasQuery))
Example #35
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 #36
0
 def test_set_uuid_Hardware_lifetime_fails(self):
     result = host.set_uuid('Hardware', testUtil.getRandomKey(20) )
     self.assertEqual(result.get('rc'), 23, "Unexpected return code ("+str(result.get('rc'))+"), expected 23")
Example #37
0
 def test_run_uri_good_file_augeas(self):
     results = wrapper('uri', 'file://' + testAugeasFileWithPath, 0,
                       'augeas', testUtil.getRandomKey(5)).get('status')
     tokens = results.split('\n')
     self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
     self.assertTrue(tokens[1].startswith("%s = " % augeasQuery))
Example #38
0
    def test_run_uri_http_url_not_found_augeas(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri', testAugeasFileUrl + "_bad", 0, 'augeas', testUtil.getRandomKey(5))

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri', testAugeasFileUrl + "_bad", 0, 'augeas', testUtil.getRandomKey(5))
 def test_is_configured_known_key(self):
     key = testUtil.getRandomKey(5)
     wrapper('uri',testPuppetFileUrl, 0, 'puppet', key)
     results = sysconfig.is_configured(key)
     self.assertTrue( results.get('status') == 'OK', "result: " + str(results.get('status')) + " != OK")
Example #40
0
    def test_run_uri_file_url_not_found(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri', 'file://'+testPuppetFile, 0, 'puppet', testUtil.getRandomKey(5))
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri', 'file://'+testPuppetFile, 0, 'puppet', testUtil.getRandomKey(5))
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "DBus: file properties not expected")
 def test_is_configured_unknown_key(self):
     results = sysconfig.is_configured(testUtil.getRandomKey(5))
     self.assertTrue( results.get('status') == 'unknown', "result: " + str(results.get('status')) + " != unknown")
 def test_is_configured_failed_key(self):
     key = testUtil.getRandomKey(5)
     wrapper('string', "bad puppet manifest", 0, 'puppet', key)
     tokens = sysconfig.is_configured(key).get('status').split('\n')
     self.assertTrue(tokens[0] == 'FAILED', "result: %s != FAILED" % tokens[0])
Example #43
0
 def test_is_configured_failed_key(self):
     key = testUtil.getRandomKey(5)
     wrapper('string', "bad puppet manifest", 0, 'puppet', key)
     tokens = sysconfig.is_configured(key).get('status').split('\n')
     self.assertTrue(tokens[0] == 'FAILED',
                     "result: %s != FAILED" % tokens[0])
Example #44
0
 def test_is_configured_unknown_key(self):
     results = sysconfig.is_configured(testUtil.getRandomKey(5))
     self.assertTrue(
         results.get('status') == 'unknown',
         "result: " + str(results.get('status')) + " != unknown")
 def test_run_uri_http_url_not_found_puppet(self):
     self.assertRaises(QmfAgentException, wrapper, 'uri', testPuppetFileUrl+"_bad", 0, 'puppet', testUtil.getRandomKey(5))
     self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "file properties not expected")
Example #46
0
    def test_run_uri_file_url_not_found(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri', 'file://'+testAugeasFile, 0, 'augeas', testUtil.getRandomKey(5))

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri', 'file://'+testAugeasFile, 0, 'augeas', testUtil.getRandomKey(5))
Example #47
0
 def test_set_uuid_Reboot_lifetime_fails(self):
     result = qmf.set_uuid('Reboot', testUtil.getRandomKey(20))
     self.assertEqual(
         result.get('rc'), 23, "Unexpected return code (" +
         str(result.get('rc')) + "), expected 23")
Example #48
0
    def test_run_uri_special_chars_in_key(self):
        self.assertRaises(QmfAgentException, wrapper, qmf, 'uri', testPuppetFileUrl, 0, 'puppet', testUtil.getRandomKey(5) + "'s $$$")
        self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "QMF: file properties not expected")

        if testUtil.haveDBus:
            self.assertRaises(DBusException, wrapper, dbus, 'uri', testPuppetFileUrl, 0, 'puppet', testUtil.getRandomKey(5) + "'s $$$")
            self.assertTrue( 0 == checkFile(testPuppetFileWithPath, origFilePerms, origFileOwner, origFileGroup), "DBus: file properties not expected")
Example #49
0
 def test_set_uuid_Reboot_lifetime_fails(self):
     result = qmf.set_uuid('Reboot', testUtil.getRandomKey(20) )
     self.assertEqual(result.get('rc'), 23, "Unexpected return code ("+str(result.get('rc'))+"), expected 23")
Example #50
0
 def test_run_string_good_augeas(self):
     results = wrapper('string', augeasFileContents, 0, 'augeas',
                       testUtil.getRandomKey(5)).get('status')
     tokens = results.split('\n')
     self.assertEqual(tokens[0], 'OK', "result: %s != OK" % tokens[0])
     self.assertTrue(tokens[1].startswith("%s = " % augeasQuery))