<commit_before>"""
@file soletta_stability.py
"""

##
# @addtogroup soletta
# @brief This is soletta component
# @{
# @addtogroup soletta_stability
# @brief This is soletta_stability module
# @{
##

import os
import time
import subprocess
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import shell_cmd_timeout
from oeqa.utils.helper import get_files_dir
from oeqa.utils.decorators import tag

@tag(TestType="EFT")
class SolettaStabilityTest(oeRuntimeTest):
    """
    @class SolettaStabilityTest
    """
    def setUp(self):
        ''' initialize soletta test class 
        @fn setUp
        @param self
        @return
        '''
        (status, output) = self.target.run('mkdir /tmp/soletta-stability')
        if (status != 0):
            fbp_path = os.path.join(os.path.dirname(__file__), "files/soletta-stability.fbp")
            self.target.copy_to(fbp_path, "/tmp/soletta-stability")
            self.target.run('echo "test data" > /tmp/soletta-stability/1')
            self.target.run('echo "test data" > /tmp/soletta-stability/2')
            self.target.run('echo "test data" > /tmp/soletta-stability/3')
            self.target.run('echo "test data" > /tmp/soletta-stability/4')
            self.target.run('echo "test data" > /tmp/soletta-stability/5')
        

    def test_soletta_multiple_nodes_concurrently(self):
        ''' test multiple soletta nodes run concurrently
        @fn test_soletta_multiple_nodes_concurrently
        @param self<commit_msg>soletta_stability.py: fix the test setup bug<commit_after>"""
@file soletta_stability.py
"""

##
# @addtogroup soletta
# @brief This is soletta component
# @{
# @addtogroup soletta_stability
# @brief This is soletta_stability module
# @{
##

import os
import time
import subprocess
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import shell_cmd_timeout
from oeqa.utils.helper import get_files_dir
from oeqa.utils.decorators import tag

@tag(TestType="EFT")
class SolettaStabilityTest(oeRuntimeTest):
    """
    @class SolettaStabilityTest
    """
    def setUp(self):
        ''' initialize soletta test class 
        @fn setUp
        @param self
        @return
        '''
        (status, output) = self.target.run('if [ ! -d /tmp/soletta-stability ]; then mkdir /tmp/soletta-stability; else rm -rf /tmp/soletta-stability/*; fi')
        if (status != 0):
            self.assertEqual(status, 0, msg="/tmp/soletta-stability error: %s" % output)
        else:
            fbp_path = os.path.join(os.path.dirname(__file__), "files/soletta-stability.fbp")
            self.target.copy_to(fbp_path, "/tmp/soletta-stability")
            self.target.run('echo "test data" > /tmp/soletta-stability/1')
            self.target.run('echo "test data" > /tmp/soletta-stability/2')
            self.target.run('echo "test data" > /tmp/soletta-stability/3')
            self.target.run('echo "test data" > /tmp/soletta-stability/4')
            self.target.run('echo "test data" > /tmp/soletta-stability/5')
        

    def test_soletta_multiple_nodes_concurrently(self):
        ''' test multiple soletta nodes run concurrently
        @fn test_soletta_multiple_nodes_concurrently
        @param self
{'fraction_non_alphanumeric': 0.1225444340505145, 'fraction_numerical': 0.004053632678515747, 'mean_word_length': 2.960493827160494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '404897', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1075, 'n_words': 218}