<commit_before><commit_msg>Added script for coverage Policies_Security<commit_after>
--------------------------------------------------------------------------------------------
-----------------------------Required Shared Libraries---------------------------------------
---------------------------------------------------------------------------------------------

local commonSteps   = require('user_modules/shared_testcases/commonSteps')
local commonFunctions = require('user_modules/shared_testcases/commonFunctions')
config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0"
config.defaultProtocolVersion = 2
local storagePath = config.pathToSDL .. config.application1.registerAppInterfaceParams.appID.. "_" .. config.deviceMAC.. "/"

commonFunctions:userPrint(33, "================= Precondition ==================")
Test = require('connecttest')


function Test:ATF_Certificate_PolicyTable_EmptyValue()
commonFunctions:userPrint(33, "================= Test Case ======================")
local PolicyDBPath = nil
  if commonSteps:file_exists(tostring(config.pathToSDL) .. "/policy.sqlite") == true then
    PolicyDBPath = tostring(config.pathToSDL) .. "/policy.sqlite"
  end
  if commonSteps:file_exists(tostring(config.pathToSDL) .. "/policy.sqlite") == false then
    commonFunctions:userPrint(31, "policy.sqlite file is not found")
    self:FailTestCase("PolicyTable is not avaliable" .. tostring(PolicyDBPath))
  end
  os.execute(" sleep 2 ")
   local certificate = "sqlite3 " .. tostring(PolicyDBPath) .. " \"SELECT certificate FROM module_config WHERE rowid = 1\""
   local aHandle = assert( io.popen( certificate, 'r'))
   local certificateValue = aHandle:read( '*l' )
   if certificateValue ~= "" then
     self:FailTestCase("certificate value in DB is unexpected value " .. tostring(certificateValue))
   end
end

--[[ Postconditions ]]
commonFunctions:newTestCasesGroup("Postconditions")

Test["ForceKill"] = function (self)
os.execute("ps aux | grep smart | awk \'{print $2}\' | xargs kill -9")
os.execute("sleep 1")

return Test
end
{'fraction_non_alphanumeric': 0.25781625781625783, 'fraction_numerical': 0.030303030303030304, 'mean_word_length': 2.9923224568138194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5281631', 'n_tokens_mistral': 592, 'n_tokens_neox': 542, 'n_words': 118}