#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import common4tests as c
import unittest
import re

originalName = "virusTotal"
nuggetName = "rb-virustotal"
cwd = c.getTargetDir()
execPath = "/opt/hsn2/%s/%s" % (nuggetName, nuggetName)


class TestVirusTotal(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        # build the nugget - building not needed now assumming that we are using version installed from package.
        #c.runExternal(args=["/usr/bin/make", "%s" % originalName], cwd=cwd)
        pass

    def test_alarm(self):
        testArg1 = ""
        testArg2 = "--file=%s/test/resources/eicar" % cwd
        rexp = re.compile(r"VirusTotal\sreported\sblock\sbad")
        output = c.runExternal([execPath, testArg1, testArg2], cwd=cwd)
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import common4tests as c
import unittest
import re

originalName = "clamavNugget"
nuggetName = "rb-clamavnugget"
cwd = c.getTargetDir()
execPath = "/opt/hsn2/%s/%s" % (nuggetName, nuggetName)


class TestClamAvNugget(unittest.TestCase):
    '''
    This unit test requires clamav-daemon started with the supplied test database.
    An init.d file and the database are supplied with the integration test libraries.
    '''

    @classmethod
    def setUpClass(cls):
        # build the nugget - building not needed now assumming that we are using version installed from package.
        #c.runExternal(args=["/usr/bin/make", "%s" % originalName], cwd=cwd)
        pass