<commit_before>'use strict'
/*    Copyright 2016 Firewalla LLC
 *
 *    This program is free software: you can redistribute it and/or  modify
 *    it under the terms of the GNU Affero General Public License, version 3,
 *    as published by the Free Software Foundation.
 *
 *    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 Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if(typeof global.it === 'function') {
  return;
}

var bone = require("../lib/Bone.js");
let fConfig = require('../net2/config.js').getConfig();
let License = require('../util/license');
let SysManager = require('../net2/SysManager.js');
let sysManager = new SysManager('info');
let sampledata = require("../test/sample_data_intel.js");


/*
setTimeout(() => {
    bone.log("error", {
        msg: "test"
    });
}, 3000);
*/
/*
setTimeout(() => {
//    bone.device("identify", {});
    //bone.intel("*", "check", {iplist:[ 'www.slackbitch.com', '192.168.3.11' ]});
    bone.hashset("ad_cn",(err,data)=>{
//	console.log(typeof(data));
      let d = JSON.parse(data)
      for(let e in d) {
        console.log(d[e]);
      }
    });
}, 5000);
*/
let flowUtil = require("../net2/FlowUtil.js");

setTimeout(()=>{

     sysManager.getSysInfo((err,_sysinfo) => {
        let license = License.getLicense();
        console.log(license);
        if(err) {
          reject(err);
          return;
        }

        console.log("Checking in Cloud...");

        bone.checkin(fConfig, license, _sysinfo, (err,data) => {
            console.log(data,err);
            let mac = "9C:AD:EF:01:02:03";
            let rawData = {
                ou: mac.slice(0,13), // use 0,13 for better OU compatibility
                uuid: flowUtil.hashMac(mac)
            };
            bone.device("identify", rawData,(err,data)=>{
                console.log(data);
              //  bone.getLicense("81244056-90b9-43f3-a5ae-8681bde09e58","thisismac",(err,data)=>{
              //      console.log(err,data);
              //  });

                 let sdata = {flowlist:sampledata.netflix, hashed:1};

                 bone.intel("*","check", sdata, (err, data) => {
                     console.log(data);
                 });

            });


        });
      });
},2000);
<commit_msg>another ugly ... but simple sanity test<commit_after>'use strict'
/*    Copyright 2016 Firewalla LLC
 *
 *    This program is free software: you can redistribute it and/or  modify
 *    it under the terms of the GNU Affero General Public License, version 3,
 *    as published by the Free Software Foundation.
 *
 *    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 Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if(typeof global.it === 'function') {
  return;
}

var bone = require("../lib/Bone.js");
let fConfig = require('../net2/config.js').getConfig();
let License = require('../util/license');
let SysManager = require('../net2/SysManager.js');
let sysManager = new SysManager('info');
let sampledata = require("../tests/sample_data_intel.js");


/*
setTimeout(() => {
    bone.log("error", {
        msg: "test"
    });
}, 3000);
*/
/*
setTimeout(() => {
//    bone.device("identify", {});
    //bone.intel("*", "check", {iplist:[ 'www.slackbitch.com', '192.168.3.11' ]});
    bone.hashset("ad_cn",(err,data)=>{
//	console.log(typeof(data));
      let d = JSON.parse(data)
      for(let e in d) {
        console.log(d[e]);
      }
    });
}, 5000);
*/
let flowUtil = require("../net2/FlowUtil.js");

setTimeout(()=>{

     sysManager.getSysInfo((err,_sysinfo) => {
        let license = License.getLicense();
        console.log(license);
        if(err) {
          reject(err);
          return;
        }

        console.log("Checking in Cloud...");

        bone.checkin(fConfig, license, _sysinfo, (err,data) => {
            console.log(data,err);
            let mac = "9C:AD:EF:01:02:03";
            let rawData = {
                ou: mac.slice(0,13), // use 0,13 for better OU compatibility
                uuid: flowUtil.hashMac(mac)
            };
    bone.log("error", {
        msg: "Bone Log Test"
    }, (err,data)=> {
            bone.device("identify", rawData,(err,data)=>{
                console.log(data);
              //  bone.getLicense("81244056-90b9-43f3-a5ae-8681bde09e58","thisismac",(err,data)=>{
              //      console.log(err,data);
              //  });

                 let sdata = {flowlist:sampledata.netflix, hashed:1};

                 bone.intel("*","check", sdata, (err, data) => {
                     console.log(data);
                 });

            });
    }); 


        });
      });
},2000);

{'fraction_non_alphanumeric': 0.1623314980064553, 'fraction_numerical': 0.025061704955382572, 'mean_word_length': 2.1966019417475726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, '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': '5066043', 'n_tokens_mistral': 1724, 'n_tokens_neox': 1607, 'n_words': 397}