├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── WopiValidatorExecutor.pyproj ├── WopiValidatorExecutor.sln ├── WopiValidatorExecutor ├── ExecutorConfig.ini ├── WopiValidatorExecutor.py ├── __init__.py ├── __main__.py └── constants.py └── setup.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### WINDOWS ### 2 | Thumbs.db 3 | 4 | ### PYCHARM ### 5 | .idea/ 6 | 7 | ### PYTHON ### 8 | *.py[co] 9 | 10 | # Packages 11 | *.egg 12 | *.egg-info 13 | dist 14 | build 15 | eggs 16 | parts 17 | bin 18 | var 19 | sdist 20 | develop-eggs 21 | .installed.cfg 22 | MANIFEST 23 | 24 | # Installer logs 25 | pip-log.txt 26 | 27 | # Unit test / coverage reports 28 | .coverage 29 | .tox 30 | 31 | #Translations 32 | *.mo 33 | 34 | ### VISUAL STUDIO ### 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.userosscache 43 | *.sln.docstates 44 | 45 | # User-specific files (MonoDevelop/Xamarin Studio) 46 | *.userprefs 47 | 48 | # Build results 49 | [Dd]ebug/ 50 | [Dd]ebugPublic/ 51 | [Rr]elease/ 52 | [Rr]eleases/ 53 | x64/ 54 | x86/ 55 | build/ 56 | bld/ 57 | [Bb]in/ 58 | [Oo]bj/ 59 | 60 | # Visual Studo 2015 cache/options directory 61 | .vs/ 62 | 63 | # MSTest test Results 64 | [Tt]est[Rr]esult*/ 65 | [Bb]uild[Ll]og.* 66 | 67 | # NUNIT 68 | *.VisualState.xml 69 | TestResult.xml 70 | 71 | # Build Results of an ATL Project 72 | [Dd]ebugPS/ 73 | [Rr]eleasePS/ 74 | dlldata.c 75 | 76 | # DNX 77 | project.lock.json 78 | artifacts/ 79 | 80 | *_i.c 81 | *_p.c 82 | *_i.h 83 | *.ilk 84 | *.meta 85 | *.obj 86 | *.pch 87 | *.pdb 88 | *.pgc 89 | *.pgd 90 | *.rsp 91 | *.sbr 92 | *.tlb 93 | *.tli 94 | *.tlh 95 | *.tmp 96 | *.tmp_proj 97 | *.log 98 | *.vspscc 99 | *.vssscc 100 | .builds 101 | *.pidb 102 | *.svclog 103 | *.scc 104 | 105 | # Chutzpah Test files 106 | _Chutzpah* 107 | 108 | # Visual C++ cache files 109 | ipch/ 110 | *.aps 111 | *.ncb 112 | *.opensdf 113 | *.sdf 114 | *.cachefile 115 | 116 | # Visual Studio profiler 117 | *.psess 118 | *.vsp 119 | *.vspx 120 | 121 | # TFS 2012 Local Workspace 122 | $tf/ 123 | 124 | # Guidance Automation Toolkit 125 | *.gpState 126 | 127 | # ReSharper is a .NET coding add-in 128 | _ReSharper*/ 129 | *.[Rr]e[Ss]harper 130 | *.DotSettings.user 131 | 132 | # JustCode is a .NET coding add-in 133 | .JustCode 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # NCrunch 142 | _NCrunch_* 143 | .*crunch*.local.xml 144 | 145 | # MightyMoose 146 | *.mm.* 147 | AutoTest.Net/ 148 | 149 | # Web workbench (sass) 150 | .sass-cache/ 151 | 152 | # Installshield output folder 153 | [Ee]xpress/ 154 | 155 | # DocProject is a documentation generator add-in 156 | DocProject/buildhelp/ 157 | DocProject/Help/*.HxT 158 | DocProject/Help/*.HxC 159 | DocProject/Help/*.hhc 160 | DocProject/Help/*.hhk 161 | DocProject/Help/*.hhp 162 | DocProject/Help/Html2 163 | DocProject/Help/html 164 | 165 | # Click-Once directory 166 | publish/ 167 | 168 | # Publish Web Output 169 | *.[Pp]ublish.xml 170 | *.azurePubxml 171 | # TODO: Comment the next line if you want to checkin your web deploy settings 172 | # but database connection strings (with potential passwords) will be unencrypted 173 | *.pubxml 174 | *.publishproj 175 | 176 | # NuGet Packages 177 | *.nupkg 178 | # The packages folder can be ignored because of Package Restore 179 | **/packages/* 180 | # except build/, which is used as an MSBuild target. 181 | !**/packages/build/ 182 | # Uncomment if necessary however generally it will be regenerated when needed 183 | #!**/packages/repositories.config 184 | 185 | # Windows Azure Build Output 186 | csx/ 187 | *.build.csdef 188 | 189 | # Windows Store app package directory 190 | AppPackages/ 191 | 192 | # Visual Studio cache files 193 | # files ending in .cache can be ignored 194 | *.[Cc]ache 195 | # but keep track of directories ending in .cache 196 | !*.[Cc]ache/ 197 | 198 | # Others 199 | ClientBin/ 200 | [Ss]tyle[Cc]op.* 201 | ~$* 202 | *~ 203 | *.dbmdl 204 | *.dbproj.schemaview 205 | *.pfx 206 | *.publishsettings 207 | node_modules/ 208 | bower_components/ 209 | orleans.codegen.cs 210 | 211 | # RIA/Silverlight projects 212 | Generated_Code/ 213 | 214 | # Backup & report files from converting an old project file 215 | # to a newer Visual Studio version. Backup files are not needed, 216 | # because we have git ;-) 217 | _UpgradeReport_Files/ 218 | Backup*/ 219 | UpgradeLog*.XML 220 | UpgradeLog*.htm 221 | 222 | # SQL Server files 223 | *.mdf 224 | *.ldf 225 | 226 | # Business Intelligence projects 227 | *.rdl.data 228 | *.bim.layout 229 | *.bim_*.settings 230 | 231 | # Microsoft Fakes 232 | FakesAssemblies/ 233 | 234 | # Node.js Tools for Visual Studio 235 | .ntvs_analysis.dat 236 | 237 | # Visual Studio 6 build log 238 | *.plg 239 | 240 | # Visual Studio 6 workspace options file 241 | *.opt 242 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WopiValidatorExecutor 2 | ===================== 3 | 4 | WopiValidatorExecutor is a command line application which executes the WopiValidator tests to verify the host’s WOPI Implementation. 5 | 6 | For more details, please refer the documentation at [Wopi Validator Application](http://wopi.readthedocs.io/projects/officewopi/en/latest/testing/validator.html) 7 | 8 | Pre-requisite 9 | ------------- 10 | 11 | Ensure that you have Python Version >= `2.7` installed. 12 | 13 | **Installation Guide** 14 | 15 | * [Python Version 2.7](http://docs.python-guide.org/en/latest/starting/installation/) 16 | * [Python Version 3](https://docs.python.org/3/using/windows.html#installing-python) 17 | 18 | If you have Python 2 >= `2.7.9` or Python 3 >= `3.4` installed from python.org, you will already have `pip` and `setuptools`, but will need to upgrade to the latest version using the instructions below, (more details at - ) 19 | 20 | **On Linux or OS X** 21 | 22 | pip install -U pip setuptools 23 | 24 | **On Windows** 25 | 26 | python -m pip install -U pip setuptools 27 | 28 | Installation Steps 29 | ------------------ 30 | 31 | Installation from the source tree : 32 | 33 | $ python setup.py install 34 | 35 | * On systems similar to Unix, the installation places a `WopiValidatorExecutor-script` into a centralized `bin` directory, which should be in your `PATH`. 36 | * On Windows, `WopiValidatorExecutor.exe` will be placed into a centralized `Scripts` directory which should also be in your `PATH`. 37 | 38 | Usage 39 | ----- 40 | 41 | Run the `WopiValidatorExecutor` by passing the `WopiSrc` of the `.wopitest` file and a valid `WOPI AccessToken` enclosed in quotes. : 42 | 43 | $ WopiValidatorExecutor "wopisrc" "accesstoken" 44 | 45 | **Optional Arguments** 46 | 47 | -s: If you need to provide a specific Wopi Discovery Service Url, you can pass that Url using 48 | this argument. 49 | 50 | -c: If you need to run the WopiValidator in a specific mode, you can pass the intended 51 | VALIDATOR_TEST_CATEGORY using this argument. For more details, please refer the documentation 52 | at https://wopi.readthedocs.io/en/latest/discovery.html#term-validator-test-category 53 | 54 | -v: Using this argument will turn on verbose logging. 55 | 56 | Logs 57 | ---- 58 | 59 | A log file named `wopivalidatorexecutor.log` will be placed in the installation directory. 60 | 61 | Code of Conduct 62 | --------------- 63 | 64 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 65 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 66 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /WopiValidatorExecutor.pyproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | 2.0 6 | e485db58-f6f9-4b0f-8af4-32f08e39ec94 7 | . 8 | 9 | 10 | 11 | 12 | . 13 | . 14 | WopiValidatorExecutor 15 | WopiValidatorExecutor 16 | False 17 | {2af0f10d-7135-4994-9156-5d01c9c11b7e} 18 | 3.4 19 | 20 | 21 | true 22 | false 23 | 24 | 25 | true 26 | false 27 | 28 | 29 | 10.0 30 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {875f136a-ede5-4c73-8bc5-e149d60a99a4} 53 | {2af0f10d-7135-4994-9156-5d01c9c11b7e} 54 | 2.7 55 | validator (Python 2.7) 56 | Scripts\python.exe 57 | Scripts\pythonw.exe 58 | Lib\ 59 | PYTHONPATH 60 | X86 61 | 62 | 63 | 64 | 65 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /WopiValidatorExecutor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "WopiValidatorExecutor", "WopiValidatorExecutor.pyproj", "{E485DB58-F6F9-4B0F-8AF4-32F08E39EC94}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E485DB58-F6F9-4B0F-8AF4-32F08E39EC94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E485DB58-F6F9-4B0F-8AF4-32F08E39EC94}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /WopiValidatorExecutor/ExecutorConfig.ini: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | # The testcategory corresponds to VALIDATOR_TEST_CATEGORY - more details at https://wopi.readthedocs.io/en/latest/discovery.html#term-validator-test-category 3 | TestCategory = All 4 | 5 | # The latest Discovery Service Url for Test/Production environment can be retrieved from https://wopi.readthedocs.io/en/latest/build_test_ship/environments.html#discovery-urls 6 | WopiDiscoveryServiceUrl = https://ffc-onenote.officeapps.live.com/hosting/discovery -------------------------------------------------------------------------------- /WopiValidatorExecutor/WopiValidatorExecutor.py: -------------------------------------------------------------------------------- 1 | import json 2 | import logging 3 | import requests 4 | import sys 5 | from colorama import init, Fore, Back, Style 6 | from xml.etree import ElementTree 7 | 8 | from .constants import * 9 | 10 | 11 | def get_indented_json_dump(input_json): 12 | return json.dumps(input_json, sort_keys=True, indent=4, separators=(',', ': ')) 13 | 14 | 15 | def get_wopi_test_endpoint(wopi_discovery_service_url): 16 | logging.info("WOPI Discovery Service Url: " + wopi_discovery_service_url) 17 | discovery_service_response = requests.get(wopi_discovery_service_url) 18 | 19 | try: 20 | discovery_service_response.raise_for_status() 21 | except requests.exceptions.HTTPError as exception: 22 | print(Fore.RED + "Failed to retrieve WOPI Discovery Service XML: Check Logs for more information") 23 | logging.critical("Failed to retrieve WOPI Discovery Service XML - HTTP ErrorCode: ", exception.Code) 24 | sys.exit(1) 25 | 26 | try: 27 | discovery_xml = ElementTree.fromstring(discovery_service_response.content) 28 | wopi_test_endpoint_url = discovery_xml.find(WOPITESTAPPLICATION_NODE_PATH).attrib[ 29 | WOPITESTAPPLICATION_URLSRC_ATTRIBUTE] 30 | except Exception as exception: 31 | print(Fore.RED + "Failed to parse WOPI Discovery Service XML: Check Logs for more information") 32 | logging.critical("Failed to parse WOPI Discovery Service XML - Exception Details:", exception) 33 | sys.exit(1) 34 | 35 | return wopi_test_endpoint_url[:wopi_test_endpoint_url.find('?')] 36 | 37 | 38 | def execute_wopi_validator(wopi_discovery_service_url, payload): 39 | # Initialize colorama to allow applying colors to the output text. 40 | init(autoreset=True) 41 | 42 | wopi_test_endpoint = get_wopi_test_endpoint(wopi_discovery_service_url) 43 | logging.info("WopiValidator TestEndpoint Url: " + wopi_test_endpoint) 44 | 45 | print(Fore.CYAN + "..........................WopiValidator Execution Starts....................................\n") 46 | 47 | # Get the TestUrls by calling WopiValidator Endpoint. 48 | test_url_response = requests.get(wopi_test_endpoint, params=payload) 49 | 50 | try: 51 | test_url_response.raise_for_status() 52 | except requests.exceptions.HTTPError as exception: 53 | print(Fore.RED + "Execution Failed: Check Logs for more information") 54 | logging.critical("Failed to retrieve TestUrls - HTTP ErrorCode: ", exception.Code) 55 | sys.exit(1) 56 | 57 | testurls = test_url_response.json() 58 | logging.info("TestUrls to be Executed : \n" + get_indented_json_dump(testurls)) 59 | 60 | # Execute tests. 61 | for testurl in testurls: 62 | test_result_response = requests.get(testurl) 63 | try: 64 | test_result_response.raise_for_status() 65 | except requests.exceptions.HTTPError as exception: 66 | print(Fore.RED + "Execution Failed: Check Logs for more information") 67 | logging.critical("HTTP ErrorCode:", exception.Code) 68 | sys.exit(1) 69 | 70 | # Log the json response for the test being executed. 71 | test_result = test_result_response.json(); 72 | logging.info("Result for TestUrl:" + testurl + '\n') 73 | logging.info(get_indented_json_dump(test_result)) 74 | 75 | # Print the test result and failure reasons if any. 76 | test_case = test_result[TEST_NAME] 77 | error_msg = test_result[TEST_ERROR_MSG] 78 | msg_color = Fore.GREEN 79 | if error_msg: 80 | if error_msg == TEST_ERROR_SKIPPED: 81 | msg_color = Fore.YELLOW 82 | print(test_case + msg_color + "...Skipped...\n") 83 | else: 84 | msg_color = Fore.RED 85 | print(test_case + msg_color + "...Failed...\n") 86 | print(msg_color + error_msg + '\n') 87 | request_details = test_result[REQUEST_DETAILS] 88 | for requestDetail in request_details: 89 | validation_failures = requestDetail[REQUEST_VALIDATION_FAILURE] 90 | failed_request_name = requestDetail[REQUEST_NAME] 91 | if validation_failures: 92 | print(msg_color + "Request Failed: " + failed_request_name) 93 | print(msg_color + "*****************FailureReason Starts*********************") 94 | for validationFailure in validation_failures: 95 | print(msg_color + validationFailure) 96 | print(msg_color + "*****************FailureReason Ends***********************\n") 97 | else: 98 | print(test_case + msg_color + "...Passed...\n") 99 | 100 | print(Fore.CYAN + "..........................WopiValidator Execution Ends....................................") 101 | -------------------------------------------------------------------------------- /WopiValidatorExecutor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/wopi-validator-cli-python/f4cced1e3f96c8f3343540765d0829978b682022/WopiValidatorExecutor/__init__.py -------------------------------------------------------------------------------- /WopiValidatorExecutor/__main__.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import configparser 3 | import logging 4 | from pkg_resources import resource_filename 5 | 6 | from .constants import * 7 | 8 | 9 | # Entry Point of the Application. 10 | def main(): 11 | # Read Executor Config. 12 | config = configparser.ConfigParser() 13 | config_file = resource_filename('WopiValidatorExecutor.WopiValidatorExecutor', 'ExecutorConfig.ini') 14 | config.read(config_file) 15 | 16 | default_wopi_discovery_service_url = config['DEFAULT'][DEFAULT_WOPIDISCOVERYSERVICEURL] 17 | default_test_category = config['DEFAULT'][DEFAULT_TESTCATEGORY] 18 | 19 | # Read command line arguments. 20 | parser = argparse.ArgumentParser(description="WopiValidator Execution Program") 21 | parser.add_argument('wopisrc', type=str, help="Defines the unencoded WopiSrc Url of .WopiTest file.") 22 | parser.add_argument('accesstoken', type=str, help="Defines a valid WopiAccessToken.") 23 | parser.add_argument('-c', type=str, default=default_test_category, 24 | help="Defines the target TestCategory, It could either be All, OfficeOnline or OfficeNativeClient and is case-insensitive.") 25 | parser.add_argument('-s', type=str, default=default_wopi_discovery_service_url, 26 | help="This represents the WOPI Discovery Service Url for OfficeOnline.") 27 | parser.add_argument('-v', action="store_const", dest='logLevel', const=logging.DEBUG, default=logging.WARNING, 28 | help="Turns on verbose logging") 29 | args = parser.parse_args() 30 | 31 | # Initialize logging. 32 | logging.basicConfig(format=EXECUTOR_LOGFORMAT, datefmt=EXECUTOR_DATEFORMAT, filename=EXECUTOR_LOGFILE_NAME, 33 | filemode='w', level=args.logLevel) 34 | 35 | # Create Payload. 36 | payload = {'testcategory': args.c, 37 | 'WOPISrc': args.wopisrc, 38 | 'access_token': args.accesstoken, 39 | 'access_token_ttl': '0'} 40 | 41 | # Execute the WopiValidator. 42 | from .WopiValidatorExecutor import execute_wopi_validator 43 | 44 | execute_wopi_validator(args.s, payload) 45 | -------------------------------------------------------------------------------- /WopiValidatorExecutor/constants.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | 4 | # Logging constants 5 | EXECUTOR_DATEFORMAT = '%m/%d/%Y %I:%M:%S %p' 6 | EXECUTOR_LOGFILE_NAME = 'wopivalidatorexecutor.log' 7 | EXECUTOR_LOGFORMAT = '%(asctime)s : %(levelname)s : %(message)s' 8 | 9 | # Executor Config Keys 10 | DEFAULT_TESTCATEGORY = 'TestCategory' 11 | DEFAULT_WOPIDISCOVERYSERVICEURL = 'WopiDiscoveryServiceUrl' 12 | 13 | # Request JSON elements 14 | REQUEST_DETAILS = 'RequestDetails' 15 | REQUEST_NAME = 'Name' 16 | REQUEST_VALIDATION_FAILURE = 'ValidationFailures' 17 | 18 | # TestCase JSON elements 19 | TEST_ERROR_MSG = 'Message' 20 | TEST_ERROR_SKIPPED = 'Prerequisites failed' 21 | TEST_NAME = 'Name' 22 | 23 | # XML Parsing constants for WOPI Discovery Service 24 | WOPITESTAPPLICATION_NODE_PATH = './/app/[@name="WopiTest"]/action/[@name="getinfo"]' 25 | WOPITESTAPPLICATION_URLSRC_ATTRIBUTE = 'urlsrc' 26 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from setuptools import setup 3 | 4 | 5 | setup(name='WopiValidatorExecutor', 6 | version='0.1.0', 7 | description="WopiValidator Executor", 8 | long_description="WopiValidatorExecutor is an automated tool that executes tests which verify the target host's WOPI implementation", 9 | install_requires=[ 10 | 'colorama==0.3.7', 11 | 'configparser==3.5.0', 12 | 'requests==2.10.0' 13 | ], 14 | packages=['WopiValidatorExecutor'], 15 | package_data={ 16 | '': ['*.ini', '*.md', '*.txt'] 17 | }, 18 | include_package_data=True, 19 | data_files=[ 20 | ('WopiValidatorExecutor', ['WopiValidatorExecutor/ExecutorConfig.ini']), 21 | ('', ['LICENSE.txt']) 22 | ], 23 | entry_points={ 24 | 'console_scripts': ['WopiValidatorExecutor = WopiValidatorExecutor.__main__:main'] 25 | }, 26 | license='MIT', 27 | url='https://wopi.readthedocs.io/en/latest/build_test_ship/validator.html', 28 | author="Microsoft Corporation", 29 | classifiers=[ 30 | 'Development Status :: 3 - Alpha', 31 | 'License :: OSI Approved :: MIT License', 32 | 'Operating System :: OS Independent', 33 | 'Environment :: Console', 34 | 'Topic :: Software Development :: Testing', 35 | 'Programming Language :: Python :: 2.7', 36 | 'Programming Language :: Python :: 3' 37 | ]) 38 | --------------------------------------------------------------------------------