简体   繁体   English

使用DSSO和XML-RPC.NET的DTM自动化

[英]DTM automation using DSSO and XML-RPC.NET

Trying to automate WHQL testing using the ONE AND ONLY document available on the subject: http://www.microsoft.com/whdc/devtools/wdk/dtm/dtm_dsso.mspx 尝试使用该主题上的一个“仅”文档自动执行WHQL测试: http : //www.microsoft.com/whdc/devtools/wdk/dtm/dtm_dsso.mspx

I've played with the example code and am able to connect, list devices, etc. From there I've created a new project, a .NET 2.0 C# class: 我已经玩过示例代码,并且能够连接,列出设备等。从那里我创建了一个新项目,.NET 2.0 C#类:

using System;
using System.Reflection;
using System.IO;
using CookComputing.XmlRpc;
using Microsoft.DistributedAutomation.DeviceSelection;
using log4net;

class WhqlXmlRpcService : XmlRpcService
{
    private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
    public static DeviceScript deviceScript;

    [XmlRpcMethod("connect")]
    public Boolean Connect(String dtm)
    {
        Boolean retVal = false;
        deviceScript = new DeviceScript();
        try
        {
            deviceScript.ConnectToNamedDataStore(dtm);
            retVal = true;
        }
        catch (Exception e)
        {
            Log.Debug("Error: " + e.Message);
        }

        return retVal;
    }
}

I'm using XML-RPC.NET to create a server that is hosted by IIS (using ASP.NET 2.0). 我正在使用XML-RPC.NET创建由IIS(使用ASP.NET 2.0)托管的服务器。 The DTM Studio is installed in C:\\Inetpub\\wwwroot\\xmlrpc\\bin, the same place where the target of my class goes, to assure there are no resolution issues with the dozen or so .dll's I reference (as instructed by the DSSO doc). DTM Studio安装在C:\\ Inetpub \\ wwwroot \\ xmlrpc \\ bin中,即我的类目标所在的位置,以确保十二个.dll的I引用没有解析问题(按照DSSO的说明) doc)。 I tried adding the necessary DSSO libraries to the GAC to avoid this, but not all of them have strong names. 为了避免这种情况,我尝试将必要的DSSO库添加到GAC中,但是并非所有人都具有强名称。 So, despite being able to see all the libraries it needs to link against (and the Studio app functions just fine installed in a non-standard location), attempting .ConnectToNamedDatastore("nameofDTM") still results in the following: 因此,尽管能够看到它需要链接的所有库(并且Studio应用程序功能可以很好地安装在非标准位置),但是尝试.ConnectToNamedDatastore(“ nameofDTM”)仍然会导致以下结果:

xmlrpclib.Fault: <Fault 0: 'Could not connect to the controller to retrieve information.  Several issues can cause this error including missing or corrupt files from the installation, running the studio application from a folder other than the install folder, and running an application that accesses the scripting APIs from a folder other than the installation folder.'>

I'm accessing the scripting APIs from the installation folder, as it's the same dir as my web service .dll, and the files aren't corrupt, because if I stick an .exe with the DSSO sample code in that same directory I can see it connect just fine in the debugger. 我正在从安装文件夹访问脚本API,因为它与我的Web服务.dll相同,并且文件没有损坏,因为如果将.exe和DSSO示例代码粘贴在同一目录中,则可以看到它在调试器中连接正常。

I'm at the end of my rope with this, and have been unable to find a helpful source for DTM/DSSO info anywhere. 我对此一无所知,一直无法在任何地方找到有用的DTM / DSSO信息来源。

Anyone done anything similar in the past, or had any success automating their WHQL testing? 有人在过去做过类似的事情,还是在自动化WHQL测试方面取得了成功?

I was unable to get this to work using an ASP.NET web service .dll, however, I was able to access the DSSO API by making my XML RPC server available using the HttpListener class in .NET. 我无法使用ASP.NET Web服务.dll使其正常工作,但是,我可以通过使用.NET中的HttpListener类使XML RPC服务器可用来访问DSSO API。 If you deploy the target application into the same directory as DTM Studio, all works as expected. 如果将目标应用程序部署到与DTM Studio相同的目录中,则所有工作都将按预期进行。

For an example of how to use XML-RPC.NET with HttpListener, see: http://www.cookcomputing.com/blog/archives/000572.html 有关如何将XML-RPC.NET与HttpListener一起使用的示例,请参见: http : //www.cookcomputing.com/blog/archives/000572.html

Note: "ListenerService" has been incorporated into the latest versions of XML-RPC.NET since the time of the linked post above. 注意:自上述链接发布之时起,“ ListenerService”已合并到XML-RPC.NET的最新版本中。 It can be found under CookComputing.XmlRpc.XmlRpcListenerService 可以在CookComputing.XmlRpc.XmlRpcListenerService下找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM