CN114626053A - A national secret certification testing method and device, and a national secret certification program and system - Google Patents

A national secret certification testing method and device, and a national secret certification program and system Download PDF

Info

Publication number
CN114626053A
CN114626053A CN202210243497.4A CN202210243497A CN114626053A CN 114626053 A CN114626053 A CN 114626053A CN 202210243497 A CN202210243497 A CN 202210243497A CN 114626053 A CN114626053 A CN 114626053A
Authority
CN
China
Prior art keywords
target
script
running
national
disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210243497.4A
Other languages
Chinese (zh)
Inventor
张亚南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huadian Communication Co ltd
Original Assignee
Shenzhen Huadian Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huadian Communication Co ltd filed Critical Shenzhen Huadian Communication Co ltd
Priority to CN202210243497.4A priority Critical patent/CN114626053A/en
Publication of CN114626053A publication Critical patent/CN114626053A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2247Verification or detection of system hardware configuration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2268Logging of test results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a test method and a test device for national secret authentication, a national secret authentication program and a national secret authentication system. The invention comprises the following steps: acquiring a plurality of disc information corresponding to a plurality of discs, and determining a target disc according to the plurality of disc information; determining at least one national password to-be-tested item corresponding to the target disk, and calling at least one target script corresponding to the at least one national password to-be-tested item in the script library according to the national password to-be-tested item; controlling at least one target script to sequentially run to obtain at least one running result corresponding to the at least one target script and at least one script running log; and generating a test report corresponding to the target disk according to the at least one operation result and the at least one script operation log. The invention solves the problems that in the related technology, the testing steps are more, the testing time is long, the experience requirement on testing personnel for carrying out national secret authentication is high, the fault tolerance rate is low, and the work cannot be done from the beginning if the replacement of the personnel or the work handover is incomplete.

Description

一种国密认证的测试方法及装置、国密认证程序及系统A national secret certification testing method and device, and a national secret certification program and system

技术领域technical field

本发明涉及国密认证领域,具体而言,涉及一种国密认证的测试方法及装置、国密认证程序及系统。The invention relates to the field of national secret authentication, in particular, to a national secret authentication testing method and device, and a national secret authentication program and system.

背景技术Background technique

相关技术中,国密认证是指对产品进行商用密码应用安全性评估,从而获得认证证书。“高安全”产品越来越受到市场的重视,而产品是否具备国密认证证书则是衡量产品质量的重要标准。对固态硬盘产品及其芯片进行国密认证,目前仅有对于结果的笼统要求,对于测试手段和测试工具并未明确。In related technologies, national secret certification refers to the security assessment of commercial cryptography applications on products to obtain certification certificates. "High security" products are increasingly valued by the market, and whether a product has a national secret certification is an important criterion for measuring product quality. At present, there are only general requirements for the results of the national secret certification of SSD products and their chips, and the testing methods and testing tools are not clear.

国密认证测试的测试项目多且杂,对于一个初次参与认证工作的人来说,首先需要了解可以调用产品安全接口的命令如何下发,预置条件是什么,中间需要注意的点在哪,以免由于自己的误操作导致测试平台和产品的损坏;其次,需要熟知国密认证对于产品的要求,合理的对安全接口进行测试,使得测试结果具有说服力;在最终阶段,测评中心会根据提交的测试报告和数据,评价产品是否符合国密要求。组成测试报告的就是测试结果,而测试结果则隐藏在众多的日志当中,需要测试人员将关键的日志截图贴在报告当中,至于测试数据,由于国密认证相当严格,会对提交的数据进行二次检测,所以必须先自验证数据以保证提交数据的质量得到保障。这种方式本身需要的测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,并且容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步。There are many and complex test items in the national secret certification test. For a person who participates in the certification work for the first time, he first needs to understand how to issue commands that can call the product security interface, what are the preset conditions, and what should be paid attention to in the middle. In order to avoid damage to the test platform and products due to your own misoperation test reports and data to evaluate whether the product meets the requirements of national secrets. The test report is composed of the test results, and the test results are hidden in many logs. The tester needs to paste the key log screenshots in the report. As for the test data, because the national secret certification is quite strict, the submitted data will be reviewed. Therefore, the data must be self-verified to ensure that the quality of the submitted data is guaranteed. This method itself requires many test steps, long test time, high experience requirements for the testers who conduct national secret certification, and low fault tolerance rate. level.

针对相关技术中存在的上述问题,目前尚未提出有效的解决方案。For the above problems existing in the related art, no effective solution has been proposed yet.

发明内容SUMMARY OF THE INVENTION

本发明的主要目的在于提供一种国密认证的测试方法及装置、国密认证程序及系统,以解决相关技术中测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步的问题。The main purpose of the present invention is to provide a test method and device for national secret certification, a national secret certification program and system, so as to solve the problem that in the related art, there are many testing steps, long testing time, and high experience requirements for testers who perform national secret certification. , The fault tolerance rate is low. If there is a turnover of personnel or incomplete work handover, it will lead to the problem that the work cannot be started.

为了实现上述目的,根据本发明的一个方面,提供了一种国密认证的测试方法。该发明包括:获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。In order to achieve the above purpose, according to one aspect of the present invention, a testing method for national secret authentication is provided. The invention includes: acquiring multiple disc information corresponding to multiple discs, and determining a target disc according to the multiple disc information, wherein the target disc is a disc to be tested, and the disc is a data storage medium; determining the target At least one item to be tested for national secrets corresponding to the disc, and according to the item to be tested for national secrets, at least one target script corresponding to the at least one item to be tested for national secrets in the script library is called; at least one target script is controlled to run in sequence, and at least one target script is obtained. At least one running result and at least one script running log corresponding to the target script, wherein the running result is any one of the following results: running successfully, running unsuccessfully; according to the at least one running result and the at least one script running log, generate the corresponding testing report.

进一步地,获取多个盘片对应的多个盘片信息,包括:在检测到多个盘片通过背板接入至主机的情况下,下发扫盘命令,并依据扫盘命令对多个盘片进行扫描操作以获取多个盘片信息。Further, acquiring multiple disk information corresponding to multiple disks includes: in the case of detecting that multiple disks are connected to the host through the backplane, issuing a disk scan command, and according to the disk scan command The disk performs a scan operation to obtain multiple disk information.

进一步地,在确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本之前,该方法还包括:生成至少一个目标脚本;生成至少一个目标脚本,包括:获取每个目标脚本对应的操作参数,其中,操作参数至少包括以下参数:盘片操作指令、目标脚本对应的主机操作指令、目标脚本对应的读写IO指令、目标脚本对应的调用安全接口指令、目标脚本对背板下发的上下电指令;获取每个目标脚本对应的函数接口;获取目标脚本对应的脚本代码;依据操作参数、函数接口以及脚本代码,生成目标脚本。Further, before determining at least one national secret item to be tested corresponding to the target disc, and calling at least one target script corresponding to the at least one national secret item to be tested in the script library according to the national secret item to be tested, the method further includes: : generating at least one target script; generating at least one target script, including: acquiring operation parameters corresponding to each target script, wherein the operation parameters at least include the following parameters: disk operation instructions, host operation instructions corresponding to the target script, and target script corresponding read and write IO instructions, call security interface instructions corresponding to the target script, power-on and power-off instructions issued by the target script to the backplane; obtain the function interface corresponding to each target script; obtain the script code corresponding to the target script; Interface and script code to generate target script.

进一步地,在控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,该方法包括:确定目标脚本的总数量;实时获取每个目标脚本对应的运行情况,其中,运行情况为以下任意一种:运行完毕、未运行完毕;依据目标脚本的总数量和每个目标脚本对应的运行情况,确定盘片对应的当前测试进度并将当前测试进度显示在预设显示界面上。Further, before controlling at least one target script to run in sequence, and obtaining at least one running result and at least one script running log corresponding to at least one target script, the method includes: determining the total number of target scripts; The running status, wherein the running status is any of the following: running completed or not running completed; according to the total number of target scripts and the running status corresponding to each target script, determine the current test progress corresponding to the disk and display the current test progress on the default display interface.

进一步地,控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果,包括:判断每个目标脚本是否运行完成;在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败;依据目标脚本的运行状态确定目标脚本对应的运行结果。Further, controlling at least one target script to run sequentially, and obtaining at least one running result corresponding to at least one target script, includes: judging whether each target script is completed; when the target script completes the running process, the running state of the target script is determined. Set to success; if an error occurs during the running of the target script, the running process of the target script is aborted, and the running status of the target script is set to fail; the running result corresponding to the target script is determined according to the running status of the target script.

进一步地,在目标脚本运行过程中出现错误的情况下,该方法还包括:判断错误是否为预设错误;在错误为预设错误的情况下,中止盘片对应的整个测试过程。Further, in the case that an error occurs during the running of the target script, the method further includes: judging whether the error is a preset error; and in the case that the error is a preset error, suspending the entire testing process corresponding to the disc.

进一步地,依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,包括:将至少一个运行结果以及至少一个脚本运行日志,汇总至测试报告模板以生成测试报告。Further, generating a test report corresponding to the target disk according to at least one running result and at least one script running log includes: summarizing at least one running result and at least one script running log into a test report template to generate a test report.

为了实现上述目的,根据本申请的另一方面,提供了一种国密认证程序,该国密认证程序运行上述任意一项的一种国密认证的测试方法。In order to achieve the above object, according to another aspect of the present application, a national secret authentication program is provided, and the national secret authentication program runs any one of the above-mentioned testing methods for national secret authentication.

为了实现上述目的,根据本申请的另一方面,提供了一种国密认证系统,该国密认证系统包括上述国密认证程序;脚本库;主机,主机上设置有背板,背板用于容纳盘片,主机用于运行国密认证程序。In order to achieve the above purpose, according to another aspect of the present application, a national secret authentication system is provided, the national secret authentication system includes the above-mentioned national secret authentication program; a script library; It accommodates the platter, and the host is used to run the national secret authentication program.

为了实现上述目的,根据本发明的另一方面,提供了一种国密认证的测试装置。该装置包括:第一获取单元,用于获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;第一确定单元,用于确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制单元,用于控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;第一生成单元,用于依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。In order to achieve the above object, according to another aspect of the present invention, a testing device for national secret authentication is provided. The device includes: a first acquiring unit, configured to acquire multiple disc information corresponding to multiple discs, and determine a target disc according to the multiple disc information, wherein the target disc is the disc to be tested, and the disc is A medium for data storage; a first determination unit, used to determine at least one item to be tested for national secrets corresponding to the target disc, and to call at least one item to be tested for national secrets in the script library according to the item to be tested for national secrets A target script; a control unit, configured to control at least one target script to run in sequence, and obtain at least one running result corresponding to at least one target script and at least one script running log, wherein the running result is any one of the following results: running successfully, running unsuccessfully ; a first generating unit, configured to generate a test report corresponding to the target disk according to at least one running result and at least one script running log.

为了实现上述目的,根据本申请的另一方面,提供了一种计算机可读存储介质,该计算机可读存储介质包括存储的程序,其中,该程序运行上述任意一项的一种国密认证的测试方法。In order to achieve the above object, according to another aspect of the present application, a computer-readable storage medium is provided, the computer-readable storage medium includes a stored program, wherein the program runs any one of the above-mentioned national secret authentication testing method.

为了实现上述目的,根据本申请的另一方面,提供了一种处理器,处理器用于运行程序,其中,该程序运行上述任意一项的一种国密认证的测试方法。In order to achieve the above object, according to another aspect of the present application, a processor is provided, and the processor is used for running a program, wherein the program runs any one of the above-mentioned testing methods for national secret authentication.

通过本发明,采用以下步骤:获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,解决了相关技术中测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步的问题,进而达到了降低国密认证测试难度,避免测试出错的效果。According to the present invention, the following steps are adopted: acquiring a plurality of disc information corresponding to a plurality of discs, and determining a target disc according to the plurality of disc information, wherein the target disc is the disc to be tested, and the disc is the data storage disc. medium; determine at least one national secret item to be tested corresponding to the target disc, and call at least one target script corresponding to the at least one national secret item to be tested in the script library according to the national secret item to be tested; control at least one target script to run in sequence , obtain at least one running result and at least one script running log corresponding to at least one target script, wherein the running result is any one of the following results: running successfully, running unsuccessfully; according to at least one running result and at least one script running log, generate a target The test report corresponding to the disc solves the problem of many test steps and long test time in related technologies, high experience requirements for testers who conduct national secret certification, and low fault tolerance rate. The problem that leads to the point where it is impossible to start the work, and then achieves the effect of reducing the difficulty of the national secret certification test and avoiding test errors.

附图说明Description of drawings

构成本发明的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings constituting a part of the present invention are used to provide further understanding of the present invention, and the exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:

图1是根据本发明实施例提供的一种国密认证的测试方法的流程图;1 is a flow chart of a testing method for national secret authentication provided according to an embodiment of the present invention;

图2是根据本发明实施例提供的一种国密认证系统的示意图;2 is a schematic diagram of a national secret authentication system provided according to an embodiment of the present invention;

图3是根据本发明实施例提供的一种国密认证系统的界面主程序的示意图;3 is a schematic diagram of an interface main program of a national secret authentication system provided according to an embodiment of the present invention;

图4是根据本发明实施例提供的一种国密认证系统的工作流程图;4 is a work flow diagram of a national secret authentication system provided according to an embodiment of the present invention;

图5是根据本发明实施例提供的一种国密认证的测试装置的示意图。FIG. 5 is a schematic diagram of a testing device for national secret authentication provided according to an embodiment of the present invention.

具体实施方式Detailed ways

需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。It should be noted that the embodiments of the present invention and the features of the embodiments may be combined with each other under the condition of no conflict. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

根据本发明的实施例,提供了一种国密认证的测试方法。According to an embodiment of the present invention, a testing method for national secret authentication is provided.

图1是根据本发明实施例的一种国密认证的测试方法的流程图。如图1所示,该发明包括以下步骤:FIG. 1 is a flowchart of a testing method for national secret authentication according to an embodiment of the present invention. As shown in Figure 1, the invention includes the following steps:

步骤S101,获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质。Step S101 , acquiring multiple disc information corresponding to the multiple discs, and determining a target disc according to the multiple disc information, wherein the target disc is the disc to be tested, and the disc is a data storage medium.

上述地,盘片为固态硬盘,用于存储待测试数据,依据多个盘片信息确定待测试盘片。As mentioned above, the disk is a solid-state hard disk, which is used to store the data to be tested, and the disk to be tested is determined according to a plurality of disk information.

步骤S102,确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本。Step S102 , determining at least one item to be tested for national secrets corresponding to the target disc, and calling at least one target script corresponding to the at least one item to be tested for national secrets in the script library according to the item to be tested for national secrets.

上述地,国密为国家密码局认定的国产密码算法。脚本是使用一种特定的描述性语言,依据一定的格式编写的可执行文件,又称作宏或批处理文件,脚本通常可以由应用程序临时调用并执行,脚本库就是众多脚本的集合,脚本库中包含国密测试的相关脚本,每个脚本对应一个国密测试项,脚本中的参数可修改,以适应不同测试要求。As mentioned above, the national secret is a domestic encryption algorithm recognized by the State Cryptography Administration. A script is an executable file written in a certain format using a specific descriptive language, also known as a macro or batch file. A script can usually be called and executed temporarily by an application program. A script library is a collection of many scripts. The library contains relevant scripts for the national secret test, each script corresponds to a national secret test item, and the parameters in the script can be modified to suit different test requirements.

步骤S103,控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败。Step S103, controlling at least one target script to run in sequence to obtain at least one running result and at least one script running log corresponding to the at least one target script, wherein the running result is any one of the following results: running successfully or failing.

上述地,目标脚本在国密测试运行过程中将会收集其中的脚本运行日志,不同的目标脚本完成运行时可能返回成功、失败、或返回当前盘片安全状态,从而得到运行结果,其中,运行结果为运行成功或运行失败。As mentioned above, the target script will collect the script running log during the running process of the national secret test. Different target scripts may return success, failure, or return to the current disk security status when they complete the operation, so as to obtain the running result. The result is either a successful run or a failed run.

步骤S104,依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。Step S104, generating a test report corresponding to the target disk according to at least one running result and at least one script running log.

上述地,目标脚本依次运行会得到运行结果及脚本运行日志,依据至少一个运行结果及至少一个脚本运行日志,生成目标盘片对应的测试报告。As mentioned above, running the target script in sequence will obtain the running result and the script running log, and generate the test report corresponding to the target disk according to the at least one running result and the at least one script running log.

通过上述方法,本发明中的脚本库中的脚本是国密测试专用,收集的日志、测试数据,生成的测试报告均自动,不需要手动收集,在进行国密测试时,脚本控制背板上下电,不需要手动,在进行国密测试后,自行判断测试结果,不需要测试人员经验判断。Through the above method, the script in the script library of the present invention is dedicated to the national secret test, the collected logs, test data, and the generated test report are all automatic, and manual collection is not required. Electricity, no manual operation is required. After the national secret test, the test result can be judged by itself, and the experience judgment of the tester is not required.

在一种可选的实例中,获取多个盘片对应的多个盘片信息,包括:在检测到多个盘片通过背板接入至主机的情况下,下发扫盘命令,并依据扫盘命令对多个盘片进行扫描操作以获取多个盘片信息。In an optional example, acquiring multiple disk information corresponding to multiple disks includes: in the case that multiple disks are detected to be connected to the host through the backplane, issuing a disk scan command, and according to The scan disk command scans multiple disks to obtain multiple disk information.

上述地,背板用于连接主机和盘片,具有为盘片供电的作用,通过接收到的下电或上电指令将盘片电源断开或连接,主要用于当盘片配置密钥之后,盘片处于锁定状态。主机用于运行国密认证工具以及目标盘片的平台,可为个人PC或服务器,按照需求操作系统可配置windows、Linux或其他国产系统平台。在检测到多个盘片通过背板接入至主机的情况下,背板接收到来自主机的扫盘命令时,对多个盘片进行扫描操作以获取多个盘片信息。As mentioned above, the backplane is used to connect the host and the disc, and has the function of supplying power to the disc. The power supply of the disc is disconnected or connected through the received power-off or power-on command, which is mainly used when the disc is configured with a key. , the disc is locked. The host is used to run the national secret authentication tool and the platform of the target disk, which can be a personal PC or server, and the operating system can be configured with windows, Linux or other domestic system platforms according to the requirements. When it is detected that multiple disks are connected to the host through the backplane, when the backplane receives a disk scan command from the host, a scan operation is performed on the multiple disks to obtain multiple disk information.

在一种可选的实例中,在确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本之前,该方法还包括:生成至少一个目标脚本;生成至少一个目标脚本,包括:获取每个目标脚本对应的操作参数,其中,操作参数至少包括以下参数:盘片操作指令、目标脚本对应的主机操作指令、目标脚本对应的读写IO指令、目标脚本对应的调用安全接口指令、目标脚本对背板下发的上下电指令;获取每个目标脚本对应的函数接口;获取目标脚本对应的脚本代码;依据操作参数、函数接口以及脚本代码,生成目标脚本。In an optional example, at least one item to be tested for national secrets corresponding to the target disc is determined, and according to the item to be tested for national secrets, at least one target script corresponding to the at least one item to be tested for national secrets in the script library is called Before, the method further includes: generating at least one target script; generating at least one target script, including: acquiring operation parameters corresponding to each target script, wherein the operation parameters at least include the following parameters: a disk operation instruction, a host corresponding to the target script Operation instructions, read and write IO instructions corresponding to the target script, call security interface instructions corresponding to the target script, power-on and power-off instructions issued by the target script to the backplane; obtain the function interface corresponding to each target script; obtain the script code corresponding to the target script ; Generate target script according to operation parameters, function interface and script code.

上述地,盘片操作指令包括信息查询、扫盘等,目标脚本对应的主机操作指令包括主机时间查询、进程监控等,目标脚本对应的读写IO指令为CPU用来控制读写输入、输出的指令,目标脚本对应的调用安全接口指令包括密钥管理、身份认证、SM2/SM3/SM4等,目标脚本对背板下发的上下电指令为作用为将盘片电源断开或连接,实现了通过脚本控制盘片的上下电,不需要人工手动。获取每个目标脚本对应的操作参数、每个目标脚本对应的函数接口、目标脚本对应的脚本代码,依据上述获取的内容,生成目标脚本。As mentioned above, the disk operation instructions include information query, disk scan, etc., the host operation instructions corresponding to the target script include host time query, process monitoring, etc., and the read and write IO instructions corresponding to the target script are used by the CPU to control read and write input and output. The command, the call security interface command corresponding to the target script includes key management, identity authentication, SM2/SM3/SM4, etc. The power-on and power-off commands issued by the target script to the backplane are used to disconnect or connect the power supply of the disk, which realizes The power-on and power-off of the platter is controlled by script, and manual operation is not required. Obtain the operation parameters corresponding to each target script, the function interface corresponding to each target script, and the script code corresponding to the target script, and generate the target script according to the obtained content.

在一种可选的实例中,在控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,该方法包括:确定目标脚本的总数量;实时获取每个目标脚本对应的运行情况,其中,运行情况为以下任意一种:运行完毕、未运行完毕;依据目标脚本的总数量和每个目标脚本对应的运行情况,确定盘片对应的当前测试进度并将当前测试进度显示在预设显示界面上。In an optional example, before controlling at least one target script to run in sequence, and obtaining at least one running result corresponding to at least one target script and at least one script running log, the method includes: determining the total number of target scripts; obtaining in real time The running status corresponding to each target script, wherein the running status is any one of the following: completed or not completed; according to the total number of target scripts and the running status corresponding to each target script, the current test progress corresponding to the disk is determined And display the current test progress on the preset display interface.

上述地,多个目标脚本依次运行,运行情况分为运行完毕和未运行完毕,依据目标脚本的总数量和每个目标脚本对应的运行情况,盘片对应的当前测试进度会显示在预设显示界面上。As mentioned above, multiple target scripts are run in sequence, and the running status is divided into finished and unfinished. According to the total number of target scripts and the corresponding running status of each target script, the current test progress corresponding to the disc will be displayed in the preset display. on the interface.

在一种可选的实例中,控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果,包括:判断每个目标脚本是否运行完成;在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败;依据目标脚本的运行状态确定目标脚本对应的运行结果。In an optional example, controlling at least one target script to run in sequence, and obtaining at least one running result corresponding to at least one target script, includes: judging whether each target script has finished running; when the target script completes the running process, Set the running status of the target script to success; if an error occurs during the running of the target script, abort the running process of the target script and set the running status of the target script to fail; determine the corresponding target script according to the running status of the target script result of the operation.

上述地,目标脚本可通过匹配字段识别当前运行的脚本,判断当前脚本是否运行成功,在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败。As mentioned above, the target script can identify the currently running script through the matching field, and judge whether the current script runs successfully. When the target script completes the running process, the running state of the target script is set to be successful; an error occurs during the running process of the target script. , abort the running process of the target script and set the running status of the target script to failed.

在一种可选的实例中,在目标脚本运行过程中出现错误的情况下,该方法还包括:判断错误是否为预设错误;在错误为预设错误的情况下,中止盘片对应的整个测试过程。In an optional example, in the case that an error occurs during the running of the target script, the method further includes: judging whether the error is a preset error; in the case that the error is a preset error, aborting the entire process corresponding to the disc Testing process.

上述地,目标脚本运行中若出现预设错误会导致盘片无法使用,因此需要判断错误是否为预设错误,错误为预设错误的情况下,中止盘片对应的整个测试过程。As mentioned above, if a preset error occurs during the execution of the target script, the disc will be unusable, so it is necessary to determine whether the error is a preset error, and if the error is a preset error, the entire testing process corresponding to the disc is terminated.

在一种可选的实例中,依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,包括:将至少一个运行结果以及至少一个脚本运行日志,汇总至测试报告模板以生成测试报告。In an optional example, generating a test report corresponding to the target disk according to at least one running result and at least one script running log includes: summarizing at least one running result and at least one script running log into a test report template to Generate test reports.

上述地,整个测试流程由脚本完成,节省人力,包括运行结果和脚本运行日志都可以通过匹配字段的方法自动收集,并且至测试报告模板以生成测试报告,节约时间。As mentioned above, the entire test process is completed by scripts, saving manpower, including running results and script running logs, which can be automatically collected by matching fields, and sent to the test report template to generate a test report, saving time.

本发明实施例提供的一种国密认证的测试方法,通过获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,解决了相关技术中测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步的问题,进而达到了降低国密认证测试难度,避免测试出错的效果。An embodiment of the present invention provides a testing method for national secret authentication, by acquiring multiple disc information corresponding to multiple discs, and determining a target disc according to the multiple disc information, wherein the target disc is the disc to be tested The disk is the medium for data storage; determine at least one item to be tested for national secrets corresponding to the target disk, and call at least one target script corresponding to the at least one item to be tested for national secrets in the script library according to the item to be tested for national secrets ; Control at least one target script to run in sequence, and obtain at least one running result corresponding to at least one target script and at least one script running log, wherein the running result is any one of the following results: running successfully, running unsuccessfully; according to at least one running result and At least one script running log generates a test report corresponding to the target disk, which solves the problem of many test steps in related technologies, long test time, high experience requirements for testers who perform national secret certification, and low fault tolerance rate. If there is a replacement of personnel Or incomplete work handover will lead to the problem of inability to start the work, thereby reducing the difficulty of the national secret certification test and avoiding test errors.

需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可运行指令的计算机系统中运行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序运行所示出或描述的步骤。It should be noted that the steps shown in the flowcharts of the accompanying drawings may be executed in a computer system, such as a set of computer-executable instructions, and, although a logical sequence is shown in the flowcharts, in some cases, The steps shown or described may be performed in an order different from that herein.

本发明实施例提供了一种国密认证程序,需要说明的是,本发明实施例的一种国密认证程序可以用于运行本发明实施例所提供的用于一种国密认证的测试方法。The embodiment of the present invention provides a national secret authentication program. It should be noted that a national secret authentication program in the embodiment of the present invention can be used to run the test method for national secret authentication provided by the embodiment of the present invention. .

本发明实施例提供了一种国密认证系统,需要说明的是,本发明实施例的一种国密认证系统可以用于运行本发明实施例所提供的用于一种国密认证的测试方法。以下对本发明实施例提供的一种国密认证系统进行介绍。The embodiment of the present invention provides a national secret authentication system. It should be noted that a national secret authentication system of the embodiment of the present invention can be used to run the test method for national secret authentication provided by the embodiment of the present invention. . The following describes a national secret authentication system provided by an embodiment of the present invention.

图2是根据本发明实施例提供的一种国密认证系统的示意图。如图2所示,该系统包括:国密认证程序;脚本库;主机,主机上设置有背板,背板用于容纳盘片,主机用于运行国密认证程序。FIG. 2 is a schematic diagram of a national secret authentication system provided according to an embodiment of the present invention. As shown in Figure 2, the system includes: a national secret authentication program; a script library;

上述地,国密认证程序包含两部分,一部分是界面主程序,方便用户操作,在简单配置测试信息之后,可一键开始测试,并将测试进度、测试报告等展示给用户;第二部分是国密测试的相关脚本,每个脚本对应一个国密测试项。背板通过RS232串口与主机相连,用于接收下电/上电指令,背板上的盘片插槽有数据端口(SATA/pcie)和电源端口,数据端口一端连接盘片一端连接主机,电源端口连接主机电源。脚本库中的每个脚本有特定的函数接口,可以被主程序调用。As mentioned above, the national secret authentication program consists of two parts. One part is the main interface program, which is convenient for users to operate. After simply configuring the test information, the test can be started with one key, and the test progress, test report, etc. can be displayed to the user; the second part is The relevant scripts of the national secret test, each script corresponds to a national secret test item. The backplane is connected to the host through the RS232 serial port, which is used to receive power-off/power-on commands. The disk slot on the backplane has a data port (SATA/pcie) and a power port. One end of the data port is connected to the disk and the other end is connected to the host. The port is connected to the host power supply. Each script in the script library has a specific function interface that can be called by the main program.

上述地,如图3所示,图3是根据本发明实施例提供的一种国密认证系统的界面主程序的示意图,界面主程序的功能为:通过“选择盘片”按钮选择当前需要进行测试的盘片接入系统。“本次测试项”框中展示国密测试包含的测试项(每个测试项对应一个脚本库中的脚本),框中的脚本可以进行勾选,选中的测试项本次就会被主程序调用进行测试。主程序汇总每个脚本执行后的结果以及日志,显示在“日志显示”界面上。选择好盘片以及需要执行的测试项后,点击“START”一键执行并生成结果,测试过程中显示测试进度,测试结束后可导出关键日志、测试数据和测试报告。当所有测试项执行成功之后,会在“执行结果显示”框中显示本次测试结果,所有选择了的测试项全都成功则显示“通过”,若有测试项失败,则会在框中显示失败个数,失败项目名称。Above, as shown in Figure 3, Figure 3 is a schematic diagram of the interface main program of a kind of national secret authentication system provided according to the embodiment of the present invention, the function of the interface main program is: select the current needs to be carried out through the "select disc" button Tested platter access system. The "Test items of this time" box displays the test items included in the national secret test (each test item corresponds to a script in the script library). The scripts in the box can be checked, and the selected test items will be used by the main program this time. Call to test. The main program summarizes the results and logs after each script is executed, and displays them on the "Log Display" interface. After selecting the disk and the test items to be executed, click "START" to execute and generate the results. The test progress is displayed during the test process. After the test, the key log, test data and test report can be exported. When all test items are successfully executed, the test results will be displayed in the "Execution Result Display" box. If all the selected test items are successful, "Pass" will be displayed. If any test items fail, the failure will be displayed in the box. The number, the name of the failed project.

在本发明提供的一种实施例中,如图4所示,图4是根据本发明实施例提供的一种国密认证系统的工作流程图,工作流程为:盘片插在背板上接入主机,打开国密测试界面程序。点击“选择盘片”按钮,程序下发扫盘命令获取盘片信息,选择需要测试的盘片。勾选需要进行的测试项,点击“START”按钮一键进行测试。界面主程序根据勾选的测试项判断本次测试需要运行的脚本,各个脚本依次执行。脚本按照其中的流程进行国密测试项的测试,运行过程中若脚本正常执行完成,则该测试项的状态置为成功,按照需求保存执行成功日志;若出现错误则中止该脚本,该测试项的状态置为失败并读取日志并保存(若出现致命错误导致盘片无法使用,则整个测试终止)。根据所选脚本总数和执行情况,计算当前测试进度并显示在界面上。每个脚本执行成功后保存的日志也会在关键日志中实时显示。所有脚本执行结束后,根据脚本的执行情况,汇总到测试报告模板,生成测试报告。点击“结果导出”按钮,将测试数据、测试报告、相关日志保存到指定目录。In an embodiment provided by the present invention, as shown in FIG. 4 , FIG. 4 is a work flow chart of a national secret authentication system provided according to an embodiment of the present invention. Enter the host computer and open the national secret test interface program. Click the "Select Disc" button, the program will issue a scan command to obtain the disc information, and select the disc to be tested. Check the test items to be performed, and click the "START" button to perform the test with one click. The main program of the interface judges the scripts to be run in this test according to the selected test items, and each script is executed in sequence. The script tests the national secret test item according to the process. If the script is executed normally during the running process, the status of the test item is set to success, and the execution success log is saved as required; if an error occurs, the script is aborted, and the test item The status is set to fail and the log is read and saved (if a fatal error causes the disk to be unusable, the entire test is terminated). Based on the total number of selected scripts and their execution, the current test progress is calculated and displayed on the interface. The logs saved after each script is successfully executed are also displayed in real time in the key log. After all the scripts are executed, according to the execution of the scripts, they are summarized into the test report template to generate the test report. Click the "Export Results" button to save the test data, test reports, and related logs to the specified directory.

通过上述国密认证系统,国密测试界面程序布局简单易懂,没有复杂的流程,测试人员只需要知道自己的测试对象和测试项目,就可以一键测试,降低了测试难度,避免了出错的风险,测试过程中遇到的问题能直观显示,并且保存日志,便于开发人员定位问题原因。Through the above-mentioned national secret authentication system, the program layout of the national secret test interface is simple and easy to understand, and there is no complicated process. Testers only need to know their own test objects and test items, and they can test with one click, which reduces the difficulty of testing and avoids mistakes. Risks, problems encountered during the test can be displayed visually, and logs are saved to facilitate developers to locate the cause of the problem.

本发明实施例还提供了一种国密认证的测试装置,需要说明的是,本发明实施例的一种国密认证的测试装置可以用于运行本发明实施例所提供的用于一种国密认证的测试方法。以下对本发明实施例提供的一种国密认证的测试装置进行介绍。The embodiment of the present invention also provides a testing device for national secret authentication. It should be noted that the testing device for national secret authentication provided by the embodiment of the present invention can be used to run a national secret authentication test device provided by the embodiment of the present invention. Test method for encryption authentication. The following describes a testing device for national secret authentication provided by the embodiment of the present invention.

图5是根据本发明实施例的一种国密认证的测试装置的示意图。如图5所示,该装置包括:第一获取单元501,用于获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;第一确定单元502,用于确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制单元503,用于控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;第一生成单元504,用于依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。FIG. 5 is a schematic diagram of a testing device for national secret authentication according to an embodiment of the present invention. As shown in FIG. 5 , the apparatus includes: a first obtaining unit 501, configured to obtain a plurality of disc information corresponding to a plurality of discs, and determine a target disc according to the plurality of disc information, wherein the target disc is to be The test disc is a medium for data storage; the first determination unit 502 is used to determine at least one item to be tested for national secrets corresponding to the target disc, and according to the item to be tested for national secrets, call the script library with the at least one item to be tested. at least one target script corresponding to the item to be tested; the control unit 503 is configured to control the at least one target script to run sequentially, and obtain at least one running result and at least one script running log corresponding to the at least one target script, wherein the running result is any of the following One result: the operation succeeds or the operation fails; the first generating unit 504 is configured to generate a test report corresponding to the target disk according to at least one operation result and at least one script operation log.

在一种可选的实例中,第一获取单元501,包括:扫描子单元,用于在检测到多个盘片通过背板接入至主机的情况下,下发扫盘命令,并依据扫盘命令对多个盘片进行扫描操作以获取多个盘片信息。In an optional example, the first obtaining unit 501 includes: a scanning subunit, configured to issue a disk scanning command when it is detected that multiple disks are connected to the host through the backplane, and according to the scanning The disk command scans multiple disks to obtain multiple disk information.

在一种可选的实例中,该装置还包括:第二生成单元,用于在确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本之前,生成至少一个目标脚本;第二生成单元,用于生成至少一个目标脚本,包括:第一获取子单元,用于获取每个目标脚本对应的操作参数,其中,操作参数至少包括以下参数:盘片操作指令、目标脚本对应的主机操作指令、目标脚本对应的读写IO指令、目标脚本对应的调用安全接口指令、目标脚本对背板下发的上下电指令;第二获取子单元,用于获取每个目标脚本对应的函数接口;第三获取子单元,用于获取目标脚本对应的脚本代码;生成子单元,用于依据操作参数、函数接口以及脚本代码,生成目标脚本。In an optional example, the device further includes: a second generating unit, configured to determine at least one item to be tested under national secrets corresponding to the target disc, and call the script library with at least one item to be tested under the national secret according to the item to be tested under the national secret Before at least one target script corresponding to a national secret item to be tested, at least one target script is generated; the second generating unit is used to generate at least one target script, including: a first obtaining subunit, used to obtain the corresponding target script of each target script. Operation parameters, wherein the operation parameters at least include the following parameters: disk operation instructions, host operation instructions corresponding to the target script, read and write IO instructions corresponding to the target script, call security interface instructions corresponding to the target script, and the target script issued to the backplane The second acquisition subunit is used to acquire the function interface corresponding to each target script; the third acquisition subunit is used to acquire the script code corresponding to the target script; Interface and script code to generate target script.

在一种可选的实例中,该装置包括:第二确定单元,用于在控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,确定目标脚本的总数量;第二获取单元,用于实时获取每个目标脚本对应的运行情况,其中,运行情况为以下任意一种:运行完毕、未运行完毕;第三确定单元,用于依据目标脚本的总数量和每个目标脚本对应的运行情况,确定盘片对应的当前测试进度并将当前测试进度显示在预设显示界面上。In an optional example, the apparatus includes: a second determining unit, configured to determine the target before controlling the at least one target script to run in sequence and obtaining at least one running result corresponding to the at least one target script and at least one script running log the total number of scripts; the second obtaining unit is used to obtain the running status corresponding to each target script in real time, wherein the running status is any one of the following: running completed or not completed; the third determining unit is used to obtain the running status according to the target script The total number of platters and the running situation corresponding to each target script, determine the current test progress corresponding to the disc and display the current test progress on the preset display interface.

在一种可选的实例中,控制单元503,包括:判断子单元,用于判断每个目标脚本是否运行完成;设置子单元,用于在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;中止子单元,用于在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败;确定子单元,依据目标脚本的运行状态确定目标脚本对应的运行结果。In an optional example, the control unit 503 includes: a judging sub-unit for judging whether each target script is completed; a sub-unit for setting the target script to The running status is set to success; the aborting subunit is used to abort the running process of the target script when an error occurs during the running of the target script, and the running status of the target script is set to fail; The running status determines the running result corresponding to the target script.

在一种可选的实例中,该装置还包括:判断单元,用于在目标脚本运行过程中出现错误的情况下,判断错误是否为预设错误;中止单元,用于自在错误为预设错误的情况下,中止盘片对应的整个测试过程。In an optional example, the apparatus further includes: a judging unit for judging whether an error is a preset error when an error occurs during the running of the target script; an aborting unit for freeing the error to be a preset error , the entire test process corresponding to the disc is aborted.

在一种可选的实例中,第一生成单元504,包括:汇总子单元,用于将至少一个运行结果以及至少一个脚本运行日志,汇总至测试报告模板以生成测试报告。In an optional example, the first generating unit 504 includes: an aggregation subunit, configured to aggregate at least one running result and at least one script running log into a test report template to generate a test report.

本发明实施例提供的一种国密认证的测试装置,通过第一获取单元501,用于获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;第一确定单元502,用于确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制单元503,用于控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;第一生成单元504,用于依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,解决了相关技术中测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步的问题,进而达到了降低国密认证测试难度,避免测试出错的效果。A testing device for national secret authentication provided by an embodiment of the present invention is configured to acquire a plurality of disc information corresponding to a plurality of discs through the first obtaining unit 501, and determine a target disc according to the plurality of disc information, wherein , the target disk is a disk to be tested, and the disk is a medium for data storage; the first determination unit 502 is used to determine at least one item to be tested under the national secret corresponding to the target disk, and call a script according to the item to be tested under the national secret At least one target script in the library corresponding to at least one national secret item to be tested; the control unit 503 is configured to control the at least one target script to run in sequence, and obtain at least one running result corresponding to the at least one target script and at least one script running log, wherein , the operation result is any one of the following results: the operation succeeds or the operation fails; the first generating unit 504 is configured to generate a test report corresponding to the target disk according to at least one operation result and at least one script operation log, which solves the problem in the related art. There are many test steps and long test time. The experience requirements of the testers who carry out the national secret certification are high, and the fault tolerance rate is low. If there is a replacement of personnel or incomplete work handover, it will lead to the problem that the work cannot be started. Reduce the difficulty of the national secret certification test and avoid the effect of test errors.

所述一种国密认证的测试装置包括处理器和存储器,上述第一获取单元501等均作为程序单元存储在存储器中,由处理器运行存储在存储器中的上述程序单元来实现相应的功能。The testing device for national secret authentication includes a processor and a memory. The first obtaining unit 501 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.

处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来解决相关技术中测试步骤多,测试时间长,对于进行国密认证的测试人员的经验要求高,容错率低,若出现人员的更替或工作交接不完整,则会导致工作无从下手的地步的问题。The processor includes a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to one or more. By adjusting the kernel parameters, it can be solved that there are many test steps and long test time in related technologies. The experience requirements of the testers who carry out the national secret certification are high, and the fault tolerance rate is low. Complete, it will lead to problems to the point where the work cannot be started.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-persistent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read only memory (ROM) or flash memory (flash RAM), the memory including at least one memory chip.

本发明实施例提供了一种计算机可读存储介质,其上存储有程序,该程序被处理器运行时实现所述一种国密认证的测试方法。An embodiment of the present invention provides a computer-readable storage medium, on which a program is stored, and when the program is run by a processor, the method for testing national secret authentication is implemented.

本发明实施例提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时运行所述一种国密认证的测试方法。An embodiment of the present invention provides a processor for running a program, wherein when the program runs, the method for testing a national secret authentication is executed.

本发明实施例提供了一种设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器运行程序时实现以下步骤:获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。An embodiment of the present invention provides a device. The device includes a processor, a memory, and a program stored in the memory and running on the processor. When the processor runs the program, the following steps are implemented: acquiring multiple disks corresponding to multiple disks disc information, and determine the target disc according to a plurality of disc information, wherein, the target disc is the disc to be tested, and the disc is the data storage medium; determine at least one item to be tested corresponding to the target disc, and according to State secret items to be tested, call at least one target script corresponding to at least one state secret item to be tested in the script library; control at least one target script to run in sequence to obtain at least one running result corresponding to at least one target script and at least one script running log , wherein the running result is any one of the following results: running successfully or failing; generating a test report corresponding to the target disk according to at least one running result and at least one script running log.

进一步地,获取多个盘片对应的多个盘片信息,包括:在检测到多个盘片通过背板接入至主机的情况下,下发扫盘命令,并依据扫盘命令对多个盘片进行扫描操作以获取多个盘片信息。Further, acquiring multiple disk information corresponding to multiple disks includes: in the case of detecting that multiple disks are connected to the host through the backplane, issuing a disk scan command, and according to the disk scan command The disk performs a scan operation to obtain multiple disk information.

进一步地,在确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本之前,该方法还包括:生成至少一个目标脚本;生成至少一个目标脚本,包括:获取每个目标脚本对应的操作参数,其中,操作参数至少包括以下参数:盘片操作指令、目标脚本对应的主机操作指令、目标脚本对应的读写IO指令、目标脚本对应的调用安全接口指令、目标脚本对背板下发的上下电指令;获取每个目标脚本对应的函数接口;获取目标脚本对应的脚本代码;依据操作参数、函数接口以及脚本代码,生成目标脚本。Further, before determining at least one national secret item to be tested corresponding to the target disc, and calling at least one target script corresponding to the at least one national secret item to be tested in the script library according to the national secret item to be tested, the method further includes: : generating at least one target script; generating at least one target script, including: acquiring operation parameters corresponding to each target script, wherein the operation parameters at least include the following parameters: disk operation instructions, host operation instructions corresponding to the target script, and target script corresponding read and write IO instructions, call security interface instructions corresponding to the target script, power-on and power-off instructions issued by the target script to the backplane; obtain the function interface corresponding to each target script; obtain the script code corresponding to the target script; Interface and script code to generate target script.

进一步地,在控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,该方法包括:确定目标脚本的总数量;实时获取每个目标脚本对应的运行情况,其中,运行情况为以下任意一种:运行完毕、未运行完毕;依据目标脚本的总数量和每个目标脚本对应的运行情况,确定盘片对应的当前测试进度并将当前测试进度显示在预设显示界面上。Further, before controlling at least one target script to run in sequence, and obtaining at least one running result and at least one script running log corresponding to at least one target script, the method includes: determining the total number of target scripts; The running status, wherein the running status is any of the following: running completed or not running completed; according to the total number of target scripts and the running status corresponding to each target script, determine the current test progress corresponding to the disk and display the current test progress on the default display interface.

进一步地,控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果,包括:判断每个目标脚本是否运行完成;在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败;依据目标脚本的运行状态确定目标脚本对应的运行结果。Further, controlling at least one target script to run sequentially, and obtaining at least one running result corresponding to at least one target script, includes: judging whether each target script is completed; when the target script completes the running process, the running state of the target script is determined. Set to success; if an error occurs during the running of the target script, the running process of the target script is aborted, and the running status of the target script is set to fail; the running result corresponding to the target script is determined according to the running status of the target script.

进一步地,在目标脚本运行过程中出现错误的情况下,该方法还包括:判断错误是否为预设错误;在错误为预设错误的情况下,中止盘片对应的整个测试过程。Further, in the case that an error occurs during the running of the target script, the method further includes: judging whether the error is a preset error; and in the case that the error is a preset error, suspending the entire testing process corresponding to the disc.

进一步地,依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,包括:将至少一个运行结果以及至少一个脚本运行日志,汇总至测试报告模板以生成测试报告。Further, generating a test report corresponding to the target disk according to at least one running result and at least one script running log includes: summarizing at least one running result and at least one script running log into a test report template to generate a test report.

本文中的设备可以是服务器、PC、PAD、手机等。The devices in this article can be servers, PCs, PADs, mobile phones, and so on.

本发明还提供了一种计算机程序产品,当在数据处理设备上运行时,适于运行初始化有如下方法步骤的程序:获取多个盘片对应的多个盘片信息,并依据多个盘片信息确定目标盘片,其中,目标盘片为待测试盘片,盘片为数据存储的介质;确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本;控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,运行结果为以下任意一种结果:运行成功、运行失败;依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告。The present invention also provides a computer program product, which, when running on a data processing device, is suitable for running a program initialized with the following method steps: acquiring a plurality of disc information corresponding to a plurality of discs; The information determines the target platter, wherein the target platter is the platter to be tested, and the platter is the medium for data storage; determine at least one item to be tested under national secrets corresponding to the target platter, and call the script library according to the item to be tested under the national secret at least one target script corresponding to at least one item to be tested under state secrets; control at least one target script to run in sequence, and obtain at least one running result corresponding to at least one target script and at least one script running log, wherein the running result is any one of the following Various results: successful operation and failed operation; according to at least one operation result and at least one script operation log, a test report corresponding to the target disk is generated.

进一步地,获取多个盘片对应的多个盘片信息,包括:在检测到多个盘片通过背板接入至主机的情况下,下发扫盘命令,并依据扫盘命令对多个盘片进行扫描操作以获取多个盘片信息。Further, acquiring multiple disk information corresponding to multiple disks includes: in the case of detecting that multiple disks are connected to the host through the backplane, issuing a disk scan command, and according to the disk scan command The disk performs a scan operation to obtain multiple disk information.

进一步地,在确定目标盘片对应的至少一个国密待测试项,并依据国密待测试项,调用脚本库中与至少一个国密待测试项对应的至少一个目标脚本之前,该方法还包括:生成至少一个目标脚本;生成至少一个目标脚本,包括:获取每个目标脚本对应的操作参数,其中,操作参数至少包括以下参数:盘片操作指令、目标脚本对应的主机操作指令、目标脚本对应的读写IO指令、目标脚本对应的调用安全接口指令、目标脚本对背板下发的上下电指令;获取每个目标脚本对应的函数接口;获取目标脚本对应的脚本代码;依据操作参数、函数接口以及脚本代码,生成目标脚本。Further, before determining at least one national secret item to be tested corresponding to the target disc, and calling at least one target script corresponding to the at least one national secret item to be tested in the script library according to the national secret item to be tested, the method further includes: : generating at least one target script; generating at least one target script, including: acquiring operation parameters corresponding to each target script, wherein the operation parameters at least include the following parameters: disk operation instructions, host operation instructions corresponding to the target script, and target script corresponding read and write IO instructions, call security interface instructions corresponding to the target script, power-on and power-off instructions issued by the target script to the backplane; obtain the function interface corresponding to each target script; obtain the script code corresponding to the target script; Interface and script code to generate target script.

进一步地,在控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,该方法包括:确定目标脚本的总数量;实时获取每个目标脚本对应的运行情况,其中,运行情况为以下任意一种:运行完毕、未运行完毕;依据目标脚本的总数量和每个目标脚本对应的运行情况,确定盘片对应的当前测试进度并将当前测试进度显示在预设显示界面上。Further, before controlling at least one target script to run in sequence, and obtaining at least one running result and at least one script running log corresponding to at least one target script, the method includes: determining the total number of target scripts; The running status, wherein the running status is any of the following: running completed or not running completed; according to the total number of target scripts and the running status corresponding to each target script, determine the current test progress corresponding to the disk and display the current test progress on the default display interface.

进一步地,控制至少一个目标脚本依次运行,得到至少一个目标脚本对应的至少一个运行结果,包括:判断每个目标脚本是否运行完成;在目标脚本完成运行过程的情况下,将目标脚本的运行状态设置为成功;在目标脚本运行过程中出现错误的情况下,中止目标脚本的运行过程,并将目标脚本的运行状态设置为失败;依据目标脚本的运行状态确定目标脚本对应的运行结果。Further, controlling at least one target script to run sequentially, and obtaining at least one running result corresponding to at least one target script, includes: judging whether each target script is completed; when the target script completes the running process, the running state of the target script is determined. Set to success; if an error occurs during the running of the target script, the running process of the target script is aborted, and the running status of the target script is set to fail; the running result corresponding to the target script is determined according to the running status of the target script.

进一步地,在目标脚本运行过程中出现错误的情况下,该方法还包括:判断错误是否为预设错误;在错误为预设错误的情况下,中止盘片对应的整个测试过程。Further, in the case that an error occurs during the running of the target script, the method further includes: judging whether the error is a preset error; and in the case that the error is a preset error, suspending the entire testing process corresponding to the disc.

进一步地,依据至少一个运行结果以及至少一个脚本运行日志,生成目标盘片对应的测试报告,包括:将至少一个运行结果以及至少一个脚本运行日志,汇总至测试报告模板以生成测试报告。Further, generating a test report corresponding to the target disk according to at least one running result and at least one script running log includes: summarizing at least one running result and at least one script running log into a test report template to generate a test report.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器运行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上运行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上运行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。Memory may include non-persistent memory in computer readable media, random access memory (RAM) and/or non-volatile memory in the form of, for example, read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带、磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape, disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device comprising a series of elements includes not only those elements, but also Other elements not expressly listed, or which are inherent to such a process, method, article of manufacture, or apparatus are also included. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article of manufacture or apparatus that includes the element.

本领域技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

以上仅为本发明的实施例而已,并不用于限制本发明。对于本领域技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本发明的权利要求范围之内。The above are only embodiments of the present invention, and are not intended to limit the present invention. Various modifications and variations of the present invention are possible for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the scope of the claims of the present invention.

Claims (12)

1.一种国密认证的测试方法,其特征在于,包括:1. a test method for national secret authentication, is characterized in that, comprises: 获取多个盘片对应的多个盘片信息,并依据多个所述盘片信息确定目标盘片,其中,所述目标盘片为待测试盘片,所述盘片为数据存储的介质;Acquiring multiple pieces of disk information corresponding to multiple disks, and determining a target disk according to the multiple pieces of the disk information, wherein the target disk is a disk to be tested, and the disk is a medium for data storage; 确定所述目标盘片对应的至少一个国密待测试项,并依据所述国密待测试项,调用脚本库中与至少一个所述国密待测试项对应的至少一个目标脚本;determining at least one item to be tested for national secrets corresponding to the target disc, and calling at least one target script corresponding to at least one item to be tested for national secrets in the script library according to the item to be tested for national secrets; 控制所述至少一个所述目标脚本依次运行,得到至少一个所述目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,所述运行结果为以下任意一种结果:运行成功、运行失败;Controlling the at least one target script to run in sequence, and obtaining at least one running result and at least one script running log corresponding to at least one of the target scripts, wherein the running result is any one of the following results: running successfully, running unsuccessfully ; 依据至少一个所述运行结果以及至少一个所述脚本运行日志,生成所述目标盘片对应的测试报告。A test report corresponding to the target disk is generated according to at least one of the running results and at least one of the script running logs. 2.根据权利要求1所述的方法,其特征在于,获取多个盘片对应的多个盘片信息,包括:2. The method according to claim 1, wherein acquiring multiple disc information corresponding to multiple discs comprises: 在检测到多个所述盘片通过背板接入至主机的情况下,下发扫盘命令,并依据所述扫盘命令对多个所述盘片进行扫描操作以获取多个所述盘片信息。When it is detected that multiple disks are connected to the host through the backplane, a disk scan command is issued, and a scan operation is performed on the multiple disks according to the disk scan command to obtain multiple disks slice information. 3.根据权利要求1所述的方法,其特征在于,在确定所述目标盘片对应的至少一个国密待测试项,并依据所述国密待测试项,调用脚本库中与至少一个所述国密待测试项对应的至少一个目标脚本之前,所述方法还包括:3. The method according to claim 1, characterized in that, after determining at least one item to be tested for national secrets corresponding to the target disc, and according to the item to be tested for national secrets, calling the script library with at least one item to be tested. Before the at least one target script corresponding to the state secret item to be tested, the method further includes: 生成至少一个所述目标脚本;generating at least one of the target scripts; 生成至少一个所述目标脚本,包括:Generate at least one of the target scripts, including: 获取每个所述目标脚本对应的操作参数,其中,所述操作参数至少包括以下参数:盘片操作指令、所述目标脚本对应的主机操作指令、所述目标脚本对应的读写IO指令、所述目标脚本对应的调用安全接口指令、所述目标脚本对背板下发的上下电指令;Obtain operation parameters corresponding to each target script, wherein the operation parameters include at least the following parameters: disk operation instructions, host operation instructions corresponding to the target script, read/write IO instructions corresponding to the target script, all The calling security interface instruction corresponding to the target script, and the power-on and power-off instructions issued by the target script to the backplane; 获取每个所述目标脚本对应的函数接口;Obtain the function interface corresponding to each of the target scripts; 获取所述目标脚本对应的脚本代码;Obtain the script code corresponding to the target script; 依据所述操作参数、所述函数接口以及所述脚本代码,生成所述目标脚本。The target script is generated according to the operation parameter, the function interface and the script code. 4.根据权利要求1所述的方法,其特征在于,在控制所述至少一个所述目标脚本依次运行,得到至少一个所述目标脚本对应的至少一个运行结果以及至少一个脚本运行日志之前,所述方法包括:4 . The method according to claim 1 , wherein, before controlling the at least one target script to run in sequence, and obtaining at least one running result and at least one script running log corresponding to the at least one target script, all the The methods described include: 确定所述目标脚本的总数量;determining the total number of said target scripts; 实时获取每个所述目标脚本对应的运行情况,其中,所述运行情况为以下任意一种:运行完毕、未运行完毕;Acquiring in real time the running status corresponding to each of the target scripts, wherein the running status is any one of the following: the running has been completed, and the running has not been completed; 依据目标脚本的总数量和每个所述目标脚本对应的运行情况,确定所述盘片对应的当前测试进度并将所述当前测试进度显示在预设显示界面上。According to the total number of target scripts and the operation situation corresponding to each target script, the current test progress corresponding to the disk is determined and the current test progress is displayed on the preset display interface. 5.根据权利要求1所述的方法,其特征在于,控制所述至少一个所述目标脚本依次运行,得到至少一个所述目标脚本对应的至少一个运行结果,包括:5 . The method according to claim 1 , wherein controlling the at least one target script to run in sequence to obtain at least one running result corresponding to the at least one target script, comprising: 6 . 判断每个所述目标脚本是否运行完成;Determine whether each of the target scripts is completed; 在所述目标脚本完成所述运行过程的情况下,将所述目标脚本的运行状态设置为成功;When the target script completes the running process, setting the running status of the target script to be successful; 在所述目标脚本运行过程中出现错误的情况下,中止所述目标脚本的运行过程,并将所述目标脚本的运行状态设置为失败;In the case that an error occurs during the running process of the target script, the running process of the target script is aborted, and the running state of the target script is set to fail; 依据所述目标脚本的运行状态确定所述目标脚本对应的运行结果。A running result corresponding to the target script is determined according to the running state of the target script. 6.根据权利要求1所述的方法,其特征在于,在所述目标脚本运行过程中出现错误的情况下,所述方法还包括:6. The method according to claim 1, wherein, in the case that an error occurs during the running of the target script, the method further comprises: 判断所述错误是否为预设错误;determine whether the error is a preset error; 在所述错误为预设错误的情况下,中止所述盘片对应的整个测试过程。In the case that the error is a preset error, the entire testing process corresponding to the disk is terminated. 7.根据权利要求1所述的方法,其特征在于,依据至少一个所述运行结果以及至少一个所述脚本运行日志,生成所述目标盘片对应的测试报告,包括:7. The method according to claim 1, wherein generating a test report corresponding to the target disk according to at least one of the running results and at least one of the script running logs, comprising: 将至少一个所述运行结果以及至少一个所述脚本运行日志,汇总至测试报告模板以生成所述测试报告。Aggregate at least one of the running results and at least one of the script running logs into a test report template to generate the test report. 8.一种国密认证程序,其特征在于,所述国密认证程序运行权利要求1至7中任意一项所述的一种国密认证的测试方法。8. A national secret authentication program, characterized in that the national secret authentication program runs a test method for national secret authentication described in any one of claims 1 to 7. 9.一种国密认证系统,其特征在于,包括:9. A national secret authentication system, characterized in that, comprising: 权利要求8所述的国密认证程序;The national secret authentication program according to claim 8; 脚本库;script library; 主机,所述主机上设置有背板,所述背板用于容纳盘片,所述主机用于运行所述国密认证程序。A host, where a backplane is arranged on the host, the backplane is used for accommodating disks, and the host is used for running the national secret authentication program. 10.一种国密认证的测试装置,其特征在于,包括:10. A testing device for national secret certification, characterized in that it comprises: 第一获取单元,用于获取多个盘片对应的多个盘片信息,并依据多个所述盘片信息确定目标盘片,其中,所述目标盘片为待测试盘片,所述盘片为数据存储的介质;The first obtaining unit is configured to obtain a plurality of disc information corresponding to a plurality of discs, and determine a target disc according to the plurality of disc information, wherein the target disc is a disc to be tested, and the disc A slice is a medium for data storage; 第一确定单元,用于确定所述目标盘片对应的至少一个国密待测试项,并依据所述国密待测试项,调用脚本库中与至少一个所述国密待测试项对应的至少一个目标脚本;The first determination unit is configured to determine at least one item to be tested for national secrets corresponding to the target disc, and to call at least one item to be tested for national secrets in the script library according to the item to be tested for national secrets. a target script; 控制单元,用于控制所述至少一个所述目标脚本依次运行,得到至少一个所述目标脚本对应的至少一个运行结果以及至少一个脚本运行日志,其中,所述运行结果为以下任意一种结果:运行成功、运行失败;A control unit, configured to control the at least one target script to run in sequence, and obtain at least one running result and at least one script running log corresponding to at least one of the target scripts, wherein the running result is any one of the following results: Running successfully, running failed; 第一生成单元,用于依据至少一个所述运行结果以及至少一个所述脚本运行日志,生成所述目标盘片对应的测试报告。A first generating unit, configured to generate a test report corresponding to the target disk according to at least one of the running results and at least one of the script running logs. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备运行权利要求1至7中任意一项所述一种国密认证的测试方法。11. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein, when the program is run, the device where the computer-readable storage medium is located is controlled to run claims 1 to 7 A test method for national secret certification described in any one of the above. 12.一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时运行权利要求1至7中任意一项所述一种国密认证的测试方法。12. A processor, characterized in that the processor is used to run a program, wherein when the program is run, the test method for national secret authentication according to any one of claims 1 to 7 is executed.
CN202210243497.4A 2022-03-11 2022-03-11 A national secret certification testing method and device, and a national secret certification program and system Pending CN114626053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210243497.4A CN114626053A (en) 2022-03-11 2022-03-11 A national secret certification testing method and device, and a national secret certification program and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210243497.4A CN114626053A (en) 2022-03-11 2022-03-11 A national secret certification testing method and device, and a national secret certification program and system

Publications (1)

Publication Number Publication Date
CN114626053A true CN114626053A (en) 2022-06-14

Family

ID=81901217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210243497.4A Pending CN114626053A (en) 2022-03-11 2022-03-11 A national secret certification testing method and device, and a national secret certification program and system

Country Status (1)

Country Link
CN (1) CN114626053A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760118A (en) * 2022-11-03 2023-03-07 鼎铉商用密码测评技术(深圳)有限公司 Commercial password detection method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160004625A1 (en) * 2014-07-07 2016-01-07 Unisys Corporation Method of executing test scripts based on runtime test selection
CN108898018A (en) * 2018-07-23 2018-11-27 南方电网科学研究院有限责任公司 Program code security detection method, device and readable storage medium
CN109918338A (en) * 2019-03-11 2019-06-21 北京智芯微电子科技有限公司 Security chip operating system test device
CN110188011A (en) * 2019-05-28 2019-08-30 东信和平科技股份有限公司 A kind of smart card national secret algorithm test method and device
CN113220588A (en) * 2021-06-02 2021-08-06 北京锐安科技有限公司 Automatic testing method, device and equipment for data processing and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160004625A1 (en) * 2014-07-07 2016-01-07 Unisys Corporation Method of executing test scripts based on runtime test selection
CN108898018A (en) * 2018-07-23 2018-11-27 南方电网科学研究院有限责任公司 Program code security detection method, device and readable storage medium
CN109918338A (en) * 2019-03-11 2019-06-21 北京智芯微电子科技有限公司 Security chip operating system test device
CN110188011A (en) * 2019-05-28 2019-08-30 东信和平科技股份有限公司 A kind of smart card national secret algorithm test method and device
CN113220588A (en) * 2021-06-02 2021-08-06 北京锐安科技有限公司 Automatic testing method, device and equipment for data processing and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
北京四合天地科技有限公司: "《Web应用软件测试 高级》", vol. 1, 31 December 2021, 中国铁道出版社, pages: 319 - 320 *
徐福祥: "《卫星工程概论》", 30 June 2004, 中国宇航出版社, pages: 438 *
李兆斌;刘丹丹;黄鑫;曹浩;: "基于国密算法的安全接入设备设计与实现", 信息网络安全, no. 11, 10 November 2016 (2016-11-10) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760118A (en) * 2022-11-03 2023-03-07 鼎铉商用密码测评技术(深圳)有限公司 Commercial password detection method, device and storage medium

Similar Documents

Publication Publication Date Title
CN110992992B (en) A hard disk testing method, device and storage medium
TWI465901B (en) Method and system for verification of computerized systems for cloud testing and remote monitoring of integrated circuit devices
CN110058920B (en) Virtual machine performance detection method and device, electronic equipment and storage medium
CN104246714A (en) Software defect verification
CN109388569B (en) Method for remotely detecting environmental anomaly of client, test server and storage medium
CN112269697B (en) Equipment storage performance testing method, system and related device
CN103364650A (en) Testing system and testing method
CN108572895B (en) A Stability Test Method for Automatically Checking Software and Hardware Configuration under Linux
CN113538725B (en) Method for testing hardware products and related equipment
CN113553226B (en) Startup and shutdown testing method, device, testing system, electronic equipment and storage medium
CN115827358A (en) Automatic test system, method and device for PFR function and storage medium
CN114626053A (en) A national secret certification testing method and device, and a national secret certification program and system
WO2020001150A1 (en) Method, system and medium for instantly prompting in-position change of sata and nvme devices
CN112486785B (en) Method, system, terminal and storage medium for positioning downtime phase of server
CN110806981A (en) Application program testing method, device, equipment and storage medium
US9946853B1 (en) Techniques for application code obfuscation
CN111381995A (en) Method and device for restoring user operation and computer
CN115168119A (en) A server PCIE link detection method, device and medium
CN111858208B (en) Standby function testing method, device, equipment and medium of processor chip
CN115408192A (en) IO error detection method of virtual machine and related components thereof
CN118916242B (en) Hard disk processing method, related system, electronic device and storage medium
CN114860611B (en) A BIOS upgrade test method, device and medium
TWI796631B (en) Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same
CN116955041A (en) An NVMe hard disk testing method, system, device and medium
CN114297009B (en) A method and device for server testing, and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination