{"id":31816761,"url":"https://github.com/splunk/seckit_sa_geolocation","last_synced_at":"2025-10-11T09:58:16.324Z","repository":{"id":36980860,"uuid":"240718177","full_name":"splunk/seckit_sa_geolocation","owner":"splunk","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-04T16:39:44.000Z","size":7612,"stargazers_count":12,"open_issues_count":22,"forks_count":8,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-04-15T02:58:41.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/splunk.png","metadata":{"files":{"readme":"README-test.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2020-02-15T13:34:28.000Z","updated_at":"2024-03-22T01:32:03.000Z","dependencies_parsed_at":"2023-01-17T11:16:49.853Z","dependency_job_id":"5f3172bc-2e1c-4220-9cdd-d2c12c2e5fc8","html_url":"https://github.com/splunk/seckit_sa_geolocation","commit_stats":null,"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"purl":"pkg:github/splunk/seckit_sa_geolocation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fseckit_sa_geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fseckit_sa_geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fseckit_sa_geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fseckit_sa_geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splunk","download_url":"https://codeload.github.com/splunk/seckit_sa_geolocation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fseckit_sa_geolocation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006749,"owners_count":26084185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-11T09:58:07.071Z","updated_at":"2025-10-11T09:58:16.319Z","avatar_url":"https://github.com/splunk.png","language":"Python","readme":"\r\n# Run Addon tests in local environment\r\n\r\n## With Docker\r\n\r\n### Prerequisitory - Docker\r\n- Git\r\n- Python3 (\u003e=3.7)\r\n- Python2\r\n- crudini\r\n- Docker\r\n- Docker-compose\r\n\r\n### Steps - Docker\r\n\r\n1. Clone the repository\r\n```bash\r\ngit clone git@github.com:splunk/\u003crepo name\u003e.git\r\ncd \u003crepo dir\u003e\r\ngit submodule update --init --recursive\r\n```\r\n\r\n2. Install Requirements and Generate Addon\r\n```bash\r\npip3 install -r requirements_dev.txt\r\nucc-gen\r\n\r\n# Execute only if TEST_TYPE is modinput_functional or modinput_others\r\ncurl -s https://api.github.com/repos/splunk/splunk-add-on-for-modinput-test/releases/latest | grep \"Splunk_TA.*tar.gz\" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \\\" | wget -qi -; tar -xvzf *.tar.gz -C deps/apps/\r\n```\r\n\r\n3. Set Variables\r\n```bash\r\nexport SPLUNK_VERSION=\u003csplunk_version\u003e [i.e. latest, 8.1.0]\r\nexport SPLUNK_APP_ID=$(crudini --get package/default/app.conf id name) [i.e. Splunk_TA_addon-name]\r\nexport SPLUNK_APP_PACKAGE=output/$(ls output/) [i.e. output/Splunk_TA_addon-name]\r\nexport TEST_TYPE=\u003cknowledge|ui|modinput_functional|modinput_others\u003e\r\nexport TEST_SET=tests/$TEST_TYPE [i.e. tests/knowledge]\r\nexport IMAGE_TAG=\"3.7-browsers\"\r\nexport SC4S_VERSION=\u003csc4s_version\u003e [i.e. latest, 1.51.0]\r\n\r\n# If TEST_TYPE is ui also set the following variables\r\nexport TEST_BROWSER=\u003cbrowser_name\u003e [i.e. chrome, firefox]\r\nexport JOB_NAME=\u003cLocalRun::[addon_name]-[browser]\u003e\r\nexport SAUCE_USERNAME=\u003csauce_username\u003e\r\nexport SAUCE_PASSWORD=\u003csauce_password\u003e\r\nexport SAUCE_IDENTIFIER=$SAUCE_IDENTIFIER-$(cat /proc/sys/kernel/random/uuid)\r\nexport UI_TEST_HEADLESS=\"true\"\r\n```\r\n**Note:** If TEST_TYPE is `modinput_functional`, `modinput_others` or `ui`, also set all variables in [test_credentials.env](test_credentials.env) file with appropriate values encoded with base64.\r\n\r\n4. Docker Build and test execution\r\n```bash\r\ndocker-compose -f docker-compose.yml build\r\n\r\n# Execute only if TEST_TYPE is ui\r\n[ -z $BROWSER ] || [ \"$UI_TEST_HEADLESS\" = \"true\" ] || docker-compose -f docker-compose.yml up -d sauceconnect\r\n\r\ndocker-compose -f docker-compose.yml up -d splunk\r\nuntil docker-compose -f docker-compose.yml logs splunk | grep \"Ansible playbook complete\" ; do sleep 1; done\r\ndocker-compose -f docker-compose.yml up --abort-on-container-exit test\r\n```\r\n\r\n\r\n## With External\r\n\r\n### Prerequisitory - external\r\n- Git\r\n- Python3 (\u003e=3.7)\r\n- Python2\r\n- Splunk along with addon installed and HEC token created\r\n- If Addon support the syslog data ingestion(sc4s)\r\n  - Docker\r\n  - Docker-compose\r\n\r\n### Steps - external\r\n\r\n1. Clone the repository\r\n```bash\r\ngit clone git@github.com:splunk/\u003crepo name\u003e.git\r\ncd \u003crepo dir\u003e\r\ngit submodule update --init --recursive\r\n```\r\n\r\n2. Install Requirements\r\n```bash\r\npip3 install -r requirements_dev.txt\r\n```\r\n\r\n3. Set Variables (only if Addon supports sc4s)\r\n\r\n**Note:** Stop the existing splunk if it is running. New splunk will up after executing following steps with `Changed@11` splunk password.\r\n```bash\r\nexport SPLUNK_VERSION=\u003csplunk_version\u003e [i.e. latest, 8.1.0]\r\nexport SPLUNK_APP_ID=\u003cAddon_id\u003e [i.e. Splunk_TA_addon-name]\r\nexport SPLUNK_APP_PACKAGE=\u003csplunk_package\u003e\r\nexport IMAGE_TAG=\"3.7-browsers\"\r\nexport SC4S_VERSION=\u003csc4s_version\u003e\r\n\r\ndocker-compose -f docker-compose.yml build\r\ndocker-compose -f docker-compose.yml up -d splunk\r\n```\r\n\r\n4. Run Tests\r\n\r\n- Knowledge\r\n\r\n```bash\r\npytest -vv --splunk-type=external --splunk-app=\u003cpath-to-addon-package\u003e --splunk-data-generator=\u003cpath to pytest-splunk-addon-data.conf file\u003e --splunk-host=\u003chostname\u003e --splunk-port=\u003csplunk-management-port\u003e --splunk-user=\u003cusername\u003e --splunk-password=\u003cpassword\u003e --splunk-hec-token=\u003csplunk_hec_token\u003e --sc4s-host=\u003csc4s_host\u003e --sc4s-port=\u003csc4s_port\u003e\r\n```\r\n\r\n- UI\r\n\r\n1. Set all variables in environment mentioned at [test_credentials.env](test_credentials.env) file with appropriate values encoded with base64.\r\n2. Download Browser's specific driver\r\n    - For Chrome: download chromedriver\r\n    - For Firefox: download geckodriver\r\n    - For IE: download IEdriverserver\r\n3. Put the downloaded driver into `test/ui/` directory, make sure that it is within the environment's PATH variable, and that it is executable\r\n4. For Internet explorer, The steps mentioned at below link must be performed [selenium](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration)\r\n\r\n5. Execute the test cases\r\n ```script\r\npytest -vv --browser=\u003cbrowser\u003e --local --splunk-host=\u003cweb_url\u003e --splunk-port=\u003cmgmt_url\u003e --splunk-user=\u003cusername\u003e --splunk-password=\u003cpassword\u003e\r\n ```\r\n- Debug UI tests with selenium inside docker-compose stack.\r\n\u003eprerequisite:\r\n\u003e 1. Setup all env variables mentioned above. As BROWSER variable pickup one \"chrome_grid\" or \"firefox_grid\". TEST_TYPE=ui etc.\r\n\u003e 2. Install [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/)\r\n1. To select which test should be run we can use DEBUG_TEST variable and setup it to ingest -k parameter\r\n```bash\r\nexport DEBUG_TEST=\"-k test_name_to_run\"\r\n```\r\n2. Build images and execute the test\r\n```bash\r\ndocker-compose -f docker-compose.yml build\r\ndocker-compose -f docker-compose.yml up\r\n```\r\nTo watch the logs form docker container which run the test We can use command\r\n```bash\r\ndocker logs -f containter_test_name [ eg. docker logs -f splunk-add-on-for-servicenow_test_1]\r\n```\r\nduring the test execution when container with selenium standandalone hub is up and running We can connect to it using VNC Viewer.\r\n```bash\r\nlocalhost:6000  # chrome grid adress\r\nlocalhost:6001 # firefox grid adress\r\n```\r\nPassword is \"secret\"\r\n\r\n- Modinput\r\n\r\nInstall [splunk-add-on-for-modinput-test](https://github.com/splunk/splunk-add-on-for-modinput-test/releases/latest/) addon in splunk and set all variables in environment mentioned at [test_credentials.env](test_credentials.env) file with appropriate values encoded with base64 or add variables in pytest command mentioned in conftest file.\r\n```bash\r\npytest -vv --username=\u003csplunk_username\u003e --password=\u003csplunk_password\u003e --splunk-url=\u003csplunk_url\u003e --remote\r\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplunk%2Fseckit_sa_geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplunk%2Fseckit_sa_geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplunk%2Fseckit_sa_geolocation/lists"}