コード例 #1
0
    def testValidInputFalse(self):
        """
        Test that is work when given valid but incorrect input.
        """
        count = 802
        with tempfile.NamedTemporaryFile() as f:
            cmd = [EXT_DD, "bs=1", "if=/dev/urandom", 'of=%s' % f.name,
                   'count=%d' % count]
            rc, out, err = utils.execCmd(cmd)

        self.assertFalse(misc.validateDDBytes(err, count + 1))
コード例 #2
0
ファイル: miscTests.py プロジェクト: Caez83/vdsm
    def testValidInputFalse(self):
        """
        Test that is work when given valid but incorrect input.
        """
        count = 802
        with tempfile.NamedTemporaryFile() as f:
            cmd = [EXT_DD, "bs=1", "if=/dev/urandom", 'of=%s' % f.name,
                   'count=%d' % count]
            rc, out, err = utils.execCmd(cmd)

        self.assertFalse(misc.validateDDBytes(err, count + 1))
コード例 #3
0
ファイル: miscTests.py プロジェクト: edwardbadboy/vdsm-ubuntu
    def testValidInputTrue(self):
        """
        Test that it works when given valid and correct input.
        """
        count = 802
        with tempfile.NamedTemporaryFile() as f:
            cmd = [EXT_DD, "bs=1", "if=/dev/urandom", 'of=%s' % f.name,
                   'count=%d' % count]
            rc, out, err = misc.execCmd(cmd, sudo=False)

        self.assertTrue(misc.validateDDBytes(err, count))