Summary of the invention
In consideration of it, the purpose of the embodiment of the present invention is to propose that one kind refreshes automatically for CPLD under server B MC environmentThe method of test, after research staff has configured test parameter, refurbishing procedure automatic running does not need human intervention, and test is completedAfterwards, it automatically saves and refreshes log and as a result, improve the working efficiency of research staff.
Based on above-mentioned purpose, the one side of the embodiment of the present invention provides a kind of side for realizing CPLD refreshing and testing automaticallyMethod, comprising the following steps:
Step s1: it obtains pre- refreshing frequency and defines the variable for indicating current refreshing frequency;
Step s2: judge whether current refreshing frequency is equal to the pre- refreshing frequency;
Step s3: it is not equal to the pre- refreshing frequency in response to the current refreshing frequency, executes CPLD refreshing instruction simultaneouslyIt saves and refreshes log;
Step s4: keyword is read from the refreshing log;
Step s5: in response to reading Flushing success keyword, current refreshing frequency is made to add 1 and executing CPLD version queryingInstruction and return step s3, and refresh failure keyword in response to reading, currently refresh log in terminal output and terminateTest;
Step s6: it is equal to the pre- refreshing frequency in response to the current refreshing frequency described in step s3, terminates test.
In some embodiments, the method also includes: before performing the testing, by CPLD firmware and execute the sideThe test script of method is copied under BMC system, and runs the test script.
In some embodiments, the method also includes:, will be described by instruction before running the test scriptTest script permission is revised as readable writeable executable permission.
In some embodiments, the test script is the script based on shell language.
In some embodiments, the step s1 includes: to read the pre- refreshing frequency that user inputs from keyboard.
In some embodiments, the step s5 includes: in response to reading Flushing success keyword, by the refreshingSuccess keyword is saved in another document with the current refreshing frequency after adding 1.
In some embodiments, the step s5 further include: after executing CPLD version querying instruction, by what is inquiredCPLD version information is saved in another document.
In some embodiments, the CPLD refreshing instruction is depending on compiling generated executable file.
In some embodiments, the CPLD version querying instruction is depending on hardware design circuit.
The another aspect of the embodiment of the present invention provides a kind of device realizing CPLD refreshing and testing automatically, and feature existsIn, comprising:
At least one processor;With
Memory, the memory are stored with the program code that processor can be run, and said program code is by processorImplement method described in any of the above embodiments when operation.
The present invention has following advantageous effects: provided in an embodiment of the present invention a kind of under server B MC environmentThe method and apparatus that CPLD refreshing is tested automatically are easy to operate, and after research staff has configured test parameter, refurbishing procedure is automaticOperation, does not need human intervention;After the completion of test, automatically saves and refresh log and as a result, improve the work effect of research staffRate.
Specific embodiment
The following describe embodiment of the disclosure.It should be appreciated, however, that the disclosed embodiments are only example, andOther embodiments can take various alternative forms.The drawings are not necessarily drawn to scale;Certain functions may be exaggerated or minimumChange the details to show particular elements.Therefore, specific structure and function details disclosed herein are not necessarily to be construed as restrictive,And it is merely possible to for instructing those skilled in the art to use representative basis of the invention in various ways.As this field is generalIt is logical the skilled person will understand that, the various features with reference to shown or described by any one attached drawing can with it is one or more otherFeature shown in the drawings is combined to produce the embodiment for not being explicitly illustrated or describing.The group of shown feature is combined into typical caseProvide representative embodiment.However, the various combinations and modification of the feature consistent with the introduction of the disclosure are for certain spiesFixed application or embodiment may be desired.
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and referenceThe embodiment of the present invention is further described in attached drawing.
Based on above-mentioned purpose, on the one hand the embodiment of the present invention proposes a kind of for CPLD brush under server B MC environmentThe method newly tested automatically realizes the automatic test that CPLD refreshes by executing test script under BMC system.Of the inventionMethod the following steps are included:
Step s1: it obtains pre- refreshing frequency and defines the variable for indicating current refreshing frequency;
Step s2: judge whether current refreshing frequency is equal to the pre- refreshing frequency;
Step s3: it is not equal to the pre- refreshing frequency in response to the current refreshing frequency, executes CPLD refreshing instruction simultaneouslyIt saves and refreshes log;
Step s4: keyword is read from the refreshing log;
Step s5: in response to reading Flushing success keyword, current refreshing frequency is made to add 1 and executing CPLD version queryingInstruction and return step s3, and refresh failure keyword in response to reading, currently refresh log in terminal output and terminateTest;
Step s6: it is equal to the pre- refreshing frequency in response to the current refreshing frequency described in step s3, terminates test.
In some embodiments, the method also includes: before performing the testing, by CPLD firmware and execute the methodTest script be copied under BMC system, and run the test script.
In some embodiments, the method also includes: before running the test script, by instruction by the surveyThis permission of training is revised as readable writeable executable permission.
In some embodiments, the step s1 includes: to read the pre- refreshing frequency that user inputs from keyboard.OneIn a little embodiments, the step s5 includes: in response to reading Flushing success keyword, by Flushing success keyword and after adding 1Current refreshing frequency be saved in another document.In some embodiments, the step s5 further include: execute CPLD version and look intoAfter asking instruction, the CPLD version information inquired is saved in another document.In some embodiments, the CPLD brushNew command is depending on compiling generated executable file.In some embodiments, the CPLD version querying instructs basisDepending on hardware design circuit.
The following are according to one embodiment of present invention, as shown in Figure 1, CPLD firmware and test script are copied firstUnder to BMC system /tmp file in;Then Telnet BMC system, execute test script to refresh CPLD, includingIt is readable writeable executable permission using instruction modification test script permission and runs test script under current file folder;MostAfterwards, it after refresh testing, reads and refreshes the contents such as log to analyze test result.
In some embodiments, test script program flow diagram is as shown in Fig. 2, steps are as follows:
(1) a file CPLD_Test_Log is created first at current directory/tmp before surveying operation test scriptTo store test log, if file of the same name is existing, the content in Delete Folder and file, and a newly-built fileFolder is named as CPLD_Test_Log;
(2) the pre- refreshing times N of input is read from keyboard;
(3) variable i for indicating current refreshing frequency is defined, i initial value is 0;
(4) judge whether current refreshing frequency is equal to pre- refreshing frequency, if so, (10) are executed, if otherwise holding (5);
(5) CPLD refreshing instruction is executed, and using sentence is redirected, log will be refreshed and be saved in CPLD_Test_Log textUnder part folder, it is named as CPLD_Test_Logi.txt, wherein variable i is current refreshing frequency.Specific instruction format are as follows: CPLD brushNew command > > ./CPLD_Test_Log/CPLD_Test_Log $ i.txt, CPLD refreshing instruction can be held according to caused by compilingDepending on style of writing part.
(6) read keyword from ./CPLD_Test_Log/CPLD_Test_Log $ i.txt, judge whether refresh atFunction.Wherein keyword is a specific character string, if reading Flushing success keyword, current refreshing frequency adds 1, and will refresh atFunction keyword and current refreshing frequency are input to together in ./CPLD_Test_Log/CPLD_PASS.txt document, are then executedStep (7), it is no to then follow the steps (9), wherein reading keyword specific instruction are as follows:
Cat./CPLD_Test_Log/ " CPLD_Test_Log $ i " .txt | grep keyword > > ./CPLD_Test_Log/CPLD_PASS.txt;
(7) CPLD version querying instruction is executed, and result is output to ./CPLD_Test_Log/CPLD_PASS.txt textIn part.Concrete operations instruction are as follows: CPLD inquiry instruction > > ./CPLD_Test_Log/CPLD_PASS.txt, CPLD inquiry instructionDepending on hardware design circuit.
(8) go to step (4);
(9) output is current in the terminal refreshes error log;
(10) terminate.
In some embodiments, whether tester meets engineering according to the refreshing log analysis CPLD refurbishing procedure of acquisitionIt is required that.For example, not occurring refreshing failure phenomenon or refreshing unsuccessfully is only small probability thing after repeatedly refreshing to CPLDPart then illustrates that used CPLD refurbishing procedure meets engine request;If it is more universal to refresh failure phenomenon, illustrate that there are itHis problem or used CPLD refurbishing procedure meet engine request.
In some embodiments, the test script is the script based on shell language.The shell test script isScript file under BMC system.
In some implementations, this method can be designed as that CPLD is made to flush to some version or between multiple and different versionsSwitching refreshes, to refresh effect according to refreshing result and refreshing log analysis.
Technically in feasible situation, it can be combined with each other above in relation to technical characteristic cited by different embodiments,Or change, add and omit etc., to form the additional embodiment in the scope of the invention.
It is from above-described embodiment as can be seen that provided in an embodiment of the present invention a kind of for CPLD brush under server B MC environmentThe method newly tested automatically is easy to operate, and after research staff has configured test parameter, refurbishing procedure automatic running is not required to very important personTo intervene;After the completion of test, automatically saves and refresh log and as a result, improve the working efficiency of research staff.
The another aspect of the embodiment of the present invention proposes a kind of device one embodiment realizing CPLD refreshing and testing automatically.
The device for realizing that CPLD refreshing is tested automatically includes at least one processor and memory, and memory is stored withThe computer program that can be run on a processor, processor execute any one of the above method when executing program.
As shown in figure 3, a kind of realizing one embodiment of device that CPLD refreshing is tested automatically to be provided by the inventionHardware structural diagram.
It within the system include processor 301 and memory 302, and can also include: input dress by taking such as Fig. 3 as an exampleSet 303 and output device 304.
Processor 301, memory 302, input unit 303 and output device 304 can pass through bus or other modesIt connects, in Fig. 3 for being connected by bus.
Memory 302 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software journeySequence, non-volatile computer executable program and module, a kind of realization CPLD as described in the embodiment of the present application refresh fromCorresponding program instruction/the module of method of dynamic test.Processor 301 passes through operation storage in the memory 302 non-volatileSoftware program, instruction and module, thereby executing the various function application and data processing of server, i.e. the realization above methodThe a kind of of embodiment realizes that CPLD refreshes the method tested automatically.
Memory 302 may include storing program area and storage data area, wherein storing program area can store operation systemApplication program required for system, at least one function;Storage data area, which can be stored, refreshes automatic test according to a kind of realization CPLDDevice use created data etc..In addition, memory 302 may include high-speed random access memory, can also wrapInclude nonvolatile memory, for example, at least a disk memory, flush memory device or other non-volatile solid state memoriesPart.In some embodiments, it includes the memory remotely located relative to processor 301 that memory 302 is optional, these are remotely depositedReservoir can pass through network connection to local module.The example of above-mentioned network includes but is not limited to internet, intranet, officeDomain net, mobile radio communication and combinations thereof.
Input unit 303 can receive the number or character information of input, and generate automatic with a kind of realization CPLD refreshingThe related key signals input of the user setting and function control of the device of test.Output device 304 may include that display screen etc. is aobviousShow equipment.
A kind of one or more of corresponding program instruction of method/module storages realizing CPLD refreshing and testing automaticallyIn the memory 302, when being executed by the processor 301, the realization of one of above-mentioned any means embodiment is executedCPLD refreshes the method tested automatically.
It is described to execute a kind of described any one embodiment realized CPLD and refresh the device tested automatically, can achieve andThe identical or similar effect of corresponding aforementioned any means embodiment.
Finally, it should be noted that those of ordinary skill in the art will appreciate that realizing the whole in above-described embodiment methodOr part process, related hardware can be instructed to complete by computer program, the program can be stored in computer canIt reads in storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, described to depositStorage media can be magnetic disk, CD, read-only memory (ROM) or random access memory (RAM) etc..
In addition, typically, it can be various electric terminal equipments, example that the embodiment of the present invention, which discloses described device, equipment etc.,Such as mobile phone, personal digital assistant (PDA), tablet computer (PAD), smart television, are also possible to large-scale terminal device, such as serviceDevice etc., therefore protection scope disclosed by the embodiments of the present invention should not limit as certain certain types of device, equipment.The present invention is realApply example disclose the client can be applied to the combining form of electronic hardware, computer software or both it is above-mentioned anyIn a kind of electric terminal equipment.
In addition, disclosed method is also implemented as the computer program executed by CPU according to embodiments of the present invention, it shouldComputer program may be stored in a computer readable storage medium.When the computer program is executed by CPU, the present invention is executedThe above-mentioned function of being limited in method disclosed in embodiment.
In addition, above method step and system unit also can use controller and for storing so that controller is realThe computer readable storage medium of the computer program of existing above-mentioned steps or Elementary Function is realized.
In addition, it should be appreciated that computer readable storage medium (for example, memory) as described herein can be it is volatileProperty memory or nonvolatile memory, or may include both volatile memory and nonvolatile memory.As exampleAnd not restrictive, nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable to sonROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory.Volatile memory may include arbitrary accessMemory (RAM), the RAM can serve as external cache.As an example and not restrictive, RAM can be with moreKind form obtains, such as synchronous random access memory (DRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate SDRAM(DDR SDRAM), enhancing SDRAM (ESDRAM), synchronization link DRAM (SLDRAM) and directly Rambus RAM (DRRAM).The storage equipment of disclosed aspect is intended to the memory of including but not limited to these and other suitable type.
Those skilled in the art will also understand is that, various illustrative logical blocks, mould in conjunction with described in disclosure hereinBlock, circuit and algorithm steps may be implemented as the combination of electronic hardware, computer software or both.It is hard in order to clearly demonstrateThis interchangeability of part and software, with regard to various exemplary components, square, module, circuit and step function to its intoGeneral description is gone.This function is implemented as software and is also implemented as hardware depending on concrete application and applicationTo the design constraint of whole system.Those skilled in the art can realize described in various ways for every kind of concrete applicationFunction, but this realization decision should not be interpreted as causing a departure from range disclosed by the embodiments of the present invention.
Various illustrative logical blocks, module and circuit, which can use, in conjunction with described in disclosure herein is designed toThe following component of function described here is executed to realize or execute: general processor, digital signal processor (DSP), dedicated collectionAt circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, divideAny combination of vertical hardware component or these components.General processor can be microprocessor, but alternatively, processingDevice can be any conventional processors, controller, microcontroller or state machine.Processor also may be implemented as calculating equipmentCombination, for example, the combination of DSP and microprocessor, multi-microprocessor, one or more microprocessors combination DSP and/or anyOther this configurations.
The step of method in conjunction with described in disclosure herein or algorithm, can be directly contained in hardware, be held by processorIn capable software module or in combination of the two.Software module may reside within RAM memory, flash memory, ROM storageDevice, eprom memory, eeprom memory, register, hard disk, removable disk, CD-ROM or known in the art it is any itsIn the storage medium of its form.Illustrative storage medium is coupled to processor, enables a processor to from the storage mediumInformation is written to the storage medium in middle reading information.In an alternative, the storage medium can be with processor collectionAt together.Pocessor and storage media may reside in ASIC.ASIC may reside in user terminal.It is replaced at oneIn scheme, it is resident in the user terminal that pocessor and storage media can be used as discrete assembly.
In one or more exemplary designs, the function can be real in hardware, software, firmware or any combination thereofIt is existing.If realized in software, can be stored in using the function as one or more instruction or code computer-readableIt is transmitted on medium or by computer-readable medium.Computer-readable medium includes computer storage media and communication media,The communication media includes any medium for helping for computer program to be transmitted to another position from a position.Storage mediumIt can be any usable medium that can be accessed by a general purpose or special purpose computer.As an example and not restrictive, the computerReadable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc memory apparatus, disk storage equipment or other magneticProperty storage equipment, or can be used for carry or storage form be instruct or data structure required program code and canAny other medium accessed by general or specialized computer or general or specialized processor.In addition, any connection is okIt is properly termed as computer-readable medium.For example, if using coaxial cable, optical fiber cable, twisted pair, digital subscriber line(DSL) or such as wireless technology of infrared ray, radio and microwave to send software from website, server or other remote sources,Then above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or such as wireless technology of infrared ray, radio and microwave are included inThe definition of medium.As used herein, disk and CD include compact disk (CD), laser disk, CD, digital versatile disc(DVD), floppy disk, Blu-ray disc, wherein disk usually magnetically reproduce data, and CD using laser optics reproduce data.OnThe combination for stating content should also be as being included in the range of computer-readable medium.
It is exemplary embodiment disclosed by the invention above, it should be noted that in the sheet limited without departing substantially from claimUnder the premise of inventive embodiments scope of disclosure, it may be many modifications and modify.According to open embodiment described hereinThe function of claim to a method, step and/or movement be not required to the execution of any particular order.In addition, although the present invention is implementedElement disclosed in example can be described or be required in the form of individual, but be unless explicitly limited odd number, it is understood that be multiple.
It should be understood that it is used in the present context, unless the context clearly supports exceptions, singular " oneIt is a " it is intended to also include plural form.It is to be further understood that "and/or" used herein refers to including one or oneAny and all possible combinations of a above project listed in association.
It is for illustration only that the embodiments of the present invention disclose embodiment sequence number, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardwareIt completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readableIn storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
Above-described embodiment is the possibility example of embodiment, and is mentioned just to be clearly understood that the principle of the present inventionOut.It should be understood by those ordinary skilled in the art that: the discussion of any of the above embodiment is exemplary only, it is not intended that darkShow that range disclosed by the embodiments of the present invention (including claim) is limited to these examples;Under the thinking of the embodiment of the present invention,It can also be combined, and exist present invention as described above between technical characteristic in above embodiments or different embodimentsMany other variations of the different aspect of embodiment, for simplicity, they are not provided in details.Therefore, all of the invention realIt applies within the spirit and principle of example, any omission, modification, equivalent replacement, improvement for being made etc. should be included in implementation of the present inventionWithin the protection scope of example.