Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move MS-WOPI test suite to WOPI Validator #77

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

TingtingWen
Copy link

Changes in this PR contains 2 parts

  1. Test cases from MS-WOPI test suite.
    Because the difference between WOPI REST Documentation and [MS-WOPI], I put test cases in test suite in separate files: MS-WOPITestCases.xml and MS-WOPIFoldersTestCases.xml. Change detail in each file is listed in below.
     MS-WOPIFoldersTestCases.xml - Including test cases run against folders endpoint defined in [MS-WOPI]
     MS-WOPITestCases.xml - Including test cases run against files endpoint defined in [MS-WOPI]
     TestCases.xsd - Update based on test cases design
     Constants.cs - Add constants used by ReadSecureStore/GetRestrictedLink/RevokeRestrictedLink
     ITestCaseFactory.cs - Update for the 2 new parameters: applicationId, usingRestrictedScenario
     RequestFactory.cs - Update for the 4 new covered operations: GetRestrictedLink/RevokeRestrictedLink/ReadSecureStore/CheckFolderInfo
     ValidatorFactory.cs - For ResponseHeaderValidator, add property “IsUrl” indicates whether the header is an URL, add property “IsExcluded” indicates whether the header should not be returned; For StringProperty in JsonResponseContentValidator, add property “ShouldMatch” indicates whether the value should equal or not equal to an expected value
     MS-WOPICheckFileInfoSchema.json - Including the response schema of operation CheckFileInfo defined in [MS-WOPI]
     MS-WOPICheckFolderInfoSchema.json - Including the response schema of operation CheckFolderInfo defined in [MS-WOPI]
     ReadSecureStoreSchema.json - Including the response schema of operation ReadSecureStore defined in [MS-WOPI]
     CheckFolderInfoRequest.cs – Request for CheckFolderInfo
     GetRestrictedLinkRequest.cs – Request for GetRestrictedLink
     ReadSecureStoreRequest.cs – Request for ReadSecureStore
     RevokeRestrictedLinkRequest.cs – Request for RevokeRestrictedLink
     WopiRequestParam.cs – Add params used by ReadSecureStore/GetRestrictedLink/RevokeRestrictedLink
     TestCaseExecutor.cs – Update for cleanup process
     JsonContentValidator.cs – StringProperty in JsonResponseContentValidator, add property “ShouldMatch” indicates whether the value should equal or not equal to an expected value
     ResponseHeaderValidator.cs – add property “IsUrl” indicates whether the header is an URL, add property “IsExcluded” indicates whether the header should not be returned

  2. Verb “Discovery” to handle discovery request and send response.
    Verb design from verbs branch in https://github.com/tylerbutler/wopi-validator-core causes below changes
     ConfigParser.cs
    o Also add 2 parameters “applicationId”/”usingRestrictedScenario” used by ReadSecureStore and GetRestrictedLink/RevokeRestrictedLink
     TestCaseFactory.cs
    o Also update for the 2 parameters: applicationId, usingRestrictedScenario
     IFilterOptions.cs
     ITestCase.cs
     TestCases.cs
     TestCategory.cs
     TestExecutionData.cs
     Helpers.cs
     ListOptions.cs
     OptionsBase.cs
     RunOptions.cs
     Program.cs
    o Also update for Discovery verb
    Changes in below files caused by the new added Discovery verb
     DiscoveryListener.cs - Listen discovery request and response the discovery XML
     WopiDiscovery.cs – discovery response definition
     DiscoveryOptions.cs – Options for the discovery command.

With this change, if running against SharePoint follow below steps:

  1. Run WOPIValidator with Discovery verb
    discovery -c MS-WOPITestCases.xml -p BgIAAACkAABSU0ExAAQAAAEAAQBPCGp5yPbf1SypRwB/hytkHqQkHGpJ48v5va8wUuKWfTQ+8VOxe9D4FBtXy4zk4zoNk2nvtks43fRA/TOBPmtS9RyOcC4SZry2+s2nypzTeJvAcQgCB6aunYvla2CLngbNwj0FzmKP5tm01ac3OZXj2u76wD3ELcYstdwlzhCitQ== -o BgIAAACkAABSU0ExAAQAAAEAAQD13A415c32gUsr3xPVnY9T64tfl7ewDqBVnT1TMYjVvjI8QNrLZI2Y56XdlYlbHNRz+2s+6RFR1I04qsuBPKnxbTB/bzqoZnmcSV59Y8l6GDse15KiyZ9443Ft/4gfuIdvtXM1KzZfD4NGCJP3GPgFb3qlvHTOBjizidvCr+dX5w== --port 80
  2. Configure SharePoint
  1. Open SharePoint Management Shell
    a. New-SPWOPIBinding -ServerName xxxx –allowhttp
    b. $farm = Get-SPFarm
    c. $farm.Properties.Add("GuestSharingEnabled",$true)
    d. $farm.Properties.Add("SPO-GuestSharingUIEnabled",$true)
    e. $farm.Update()
    f. $site = Get-SPSite http://sut02
    g. $site.ShareByLinkEnabled = $true
  2. Create a secure store application and set credential owner as an user which not System Account (used by operation ReadSecureStore)
  3. Upload a document .wopitest
  4. Create a folder named liked “TestFolder”(used by CheckFolderInfo and EnumerateChildren) and run below commands
    a. $web = get-spweb http://sut02
    b. $TestFolder = $web.Lists[4].Folders[0] (indicates folder "TestFolder")
    c. $TestFolder.ProgId = "OneNote.Notebook"
    d. $TestFolder.Update()
    e. $TestFolder
  1. Run tests in WOPIValidator
    run -c MS-WOPITestCases.xml --RSACryptoKeyPairValue BwIAAACkAABSU0EyAAQAAAEAAQBPCGp5yPbf1SypRwB/hytkHqQkHGpJ48v5va8wUuKWfTQ+8VOxe9D4FBtXy4zk4zoNk2nvtks43fRA/TOBPmtS9RyOcC4SZry2+s2nypzTeJvAcQgCB6aunYvla2CLngbNwj0FzmKP5tm01ac3OZXj2u76wD3ELcYstdwlzhCitbPdeZRpnoSycxAESDhOGX9xdWZhYcJt/PHR527CXwLRuG6+1+bF491NRxvGweU6pQy1gBGei/FgZ5vv+1zLzMn1tP2NBH8wkEDa378aH/XsPwBsAwuYLWiOGdB1h9bIZiqmmiZ7SmgS/hPsp39OnqaPQQMZdcNOPin2YB6QpmrmR321pwexrk9UgYKsfAFpgtXZOxi92VOKTaQz4gQ6C37jstaBEhBQ1xtFzcCTu6hkDmEQXu0ysyQ6x9hnIIa2TlFTw7sYrb5j53VjxrvHFxwzMSRhQsTL47htPTftqBepgUDPq/jycTMXbWPzdQCFK8eJszph70G1EL7GlibcqI1EUGes7Dcl9zWWoWYMmZIafAmpxDH1NLRNfp7NPQ8eyYXbcSjwNlCl4avoHNh0RmReuIPxXPSH7sOd58CNns4flWAacXp89AwaZps+XvBIK4sQCyTdgkuu8gjuwiK6L7l9gR+TlKWt622VbHmtaTxBHjEQsYCOTXgdJmtqqZNz8wRRYdNgJJ0/aF8PcB4o/cx3Lf3zytSSafWukWf+JOPWS+adltNiHpdtyBnQRY6Q3Y96axY4bUZ7sqDjgGytOU0= --RSACryptoKeyPairOldValue BwIAAACkAABSU0EyAAQAAAEAAQD13A415c32gUsr3xPVnY9T64tfl7ewDqBVnT1TMYjVvjI8QNrLZI2Y56XdlYlbHNRz+2s+6RFR1I04qsuBPKnxbTB/bzqoZnmcSV59Y8l6GDse15KiyZ9443Ft/4gfuIdvtXM1KzZfD4NGCJP3GPgFb3qlvHTOBjizidvCr+dX58FmBxb/g+UQ4KmMRSygyFXi5FyEXaozn92UP5V6uPmi08LyOKOcHRhvDjP7zM0vZ7siYP8OEqVjDP6FPPc6+fA1V1tbsUhRVxUXhHPdvIAuKF4elHXrt9NU48nPwSi0KVOVL/xEfOHJMO42m5As02hpDCCOelNqcHq7rrCe8cT1QV9ws6CKYAqISX/SoFMlS/nObhgAmQq+qkcSEq8s8AKDwtI7v4+u+0iAJxxGiuK35/Kp3r4kxBWRVdAZfT6+YDVbp56pdz/IXg9e/qFuxnLqv5QDzZhhzQPzC0e3HvmZl2XXaWaq+eWgLsk6nes4aHENByTCNyjhntqX7qXIPkLIRf6nKekWIRc7uKGiq32GyfhTXy3+cmjOnpUvyJhy+B3I23fOcVnKveTDPb/KhC/evaGL1SA3vJEV9af9Yc6hAbNm4XC9ZNkGUCF2KQcuh7XeeMN9TsvPxOf4FJm/MhHx2N//1l/vFJRlvcb0Gv5fbgRvbueAVxgo+A3IFJ+XGCjozsKx3INYaDHFIanqYubyAjY3DEBFCFSCjjo8EFHP8pA4mlRqaSPx12bTj7rHRWZy7S+sslafTMIWN5HyMhA= --ApplicationId TestByTingting --UsingRestrictedScenario FORMS -w http://sut02/_vti_bin/wopi.ashx/files/d4afe2b9c54c44e5a5cc9bb589424353 -t eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IldQdk9DUE1iRGhPWDIxdl93OWpBUU41NVVLbyJ9.eyJhdWQiOiJ3b3BpL3N1dDAyQDNhNjIyMGYyLTkxN2QtNDZhNi04N2IwLTAzYTk2MjVhYThiNCIsImlzcyI6IjAwMDAwMDAzLTAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMDAwMEAzYTYyMjBmMi05MTdkLTQ2YTYtODdiMC0wM2E5NjI1YWE4YjQiLCJuYmYiOiIxNTUyMzU5NDA3IiwiZXhwIjoiMTU1MjM5NTQwNyIsIm5hbWVpZCI6IjAjLnd8Y29udG9zb1xcd29waXVzZXIiLCJuaWkiOiJtaWNyb3NvZnQuc2hhcmVwb2ludCIsImlzdXNlciI6InRydWUiLCJjYWNoZWtleSI6IjApLnd8cy0xLTUtMjEtNzc2ODkwMzcwLTE0OTY5Nzg3MzQtNDA3NDM0MDQwNi0yMTAyIiwiaXNsb29wYmFjayI6IlRydWUiLCJhcHBjdHgiOiJkNGFmZTJiOWM1NGM0NGU1YTVjYzliYjU4OTQyNDM1MztKaURKQzBGUzllNTJnRENwN3B4Z0d6TVFHNzA9O0RlZmF1bHQ7OzFCMDNDNDMxQUVGO1RydWU7In0.g-dGxPmtdRGH23Q1ip9L4Ola6kTZTiq2Z4Wu5nbnnxnQcorNLZrzzhWx8g4FNvaIebfpjkO1Rb_VPBoWM4qGD-2l3Zoyv2-qS7TdLDseupBK9p6UQ1_3Uf1bMvTsOp1CQEAC8SuCNAIYSlqzEPPTOpRnj0kbUrqp5LpyfuSCoL7YPANHcByZHAUoOXbdkFbaIZc-iabotchJUJNyIj86Vnyco1PTsRQPanHltCJNVdNCEFj0Ube3eUDuzUYPwNfPYpHMrqHS_sOI_2GqAVpCikHnh9FEBbIxQjobVKYqiHolztPbh8grtXMsCfa7Mr2MYllASuwRZX9KtpG4r34FGQ -l 0

NOTE: Discovery verb option “ProofKey” is the public key of Run verb option “RSACryptoKeyPairValue”; Discovery verb option “ProofKeyOld” is the public key of Run verb option “RSACryptoKeyPairOldValue”;

@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main July 21, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant