Skip to content

Commit

Permalink
initial commit for OSS Version
Browse files Browse the repository at this point in the history
  • Loading branch information
ThPoll committed Feb 17, 2022
0 parents commit 78dcf06
Show file tree
Hide file tree
Showing 21 changed files with 1,107 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ---------------------------------------------------------------------------------------------------------
# common template for handling EOL of files by Git in any OS which can be used in the individual repository
# ---------------------------------------------------------------------------------------------------------

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Git will handle the files in whatever way it thinks is best. This is a good default option.

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
# * text eol=crlf
*.sln text eol=crlf
*.bat text eol=crlf
*.ps text eol=crlf
# Git will always convert line endings to `CRLF` on checkout. You should use this for files that must keep `CRLF` endings, even on OSX or Linux.

# Declare files that will always have LF line endings on checkout.
# * text eol=lf
*.sh text eol=lf
*.nsh text eol=lf
# Git will always convert line endings to `LF` on checkout. You should use this for files that must keep LF endings, even on Windows.

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.exe binary
*.dat binary
# Git will understand that the files specified are not text, and it should not try to change them. The `binary` setting is also an alias for `-text -diff`.

# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ignore built files
*.aux
*.log
*.out
*.bbl
*.blg
*.tdo
*.toc
*.synctex.gz
8 changes: 8 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Documentation</name>
<comment></comment>
<projects>
</projects>

</projectDescription>
Binary file added book/RobotFrameworkAIO_Reference.pdf
Binary file not shown.
45 changes: 45 additions & 0 deletions book/RobotFrameworkAIO_Reference.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
% Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\documentclass[a4paper,10pt]{report}

\input{../styles/include/styles}

\begin{document}

\author{Thomas Pollerspöck \\ \\ Nguyen Huynh Tri Cuong \\ Tran Duy Ngoan \\ Mai Dinh Nam Son \\ Tran Hoang Nguyen}
\title{Specification of Robot Framework at Bosch}
\date{June 2021}


\maketitle

\begin{boxinfo}{! Information !}{
Dear reader, \\
\\
Information to users.
}
\end{boxinfo}

\tableofcontents

\listoftodos

\include{./include/code_analysis}
\include{./include/our_document}
\include{./include/apertis}

%\backmatter
%glossary and index would go here.

\end{document}
175 changes: 175 additions & 0 deletions book/include/apertis.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
% Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Apertis Pro}
\section{How to use DLT}

\subsection{dlt-daemon on Apertis}
Verify that \textbf{dlt-daemon} has installed on Apertis Pro target or not.\\
\rlog{systemctl status dlt-daemon}\\
\\
In case \textbf{dlt-daemon} is not available, follow below steps to install and
start dlt-daemon service:
\begin{itemize}
\item Install \textbf{dlt-daemon} package\\
\rlog{sudo apt install dlt-daemon}
\item Start \textbf{dlt-daemon} service\\
\rlog{sudo systemctl start dlt-daemon}
\end{itemize}

\subsection{Apertis Pro firewall configuration}
In order to capture DLT log/trace from DLT client(\textbf{DLT Viewer},
\textbf{DLTConnector}), DLT client has to comminucate with Apertis Pro
(TCP/IP protocol) via port \textbf{3490} (as default).\\
So that, this connection should be allowed on Apertis Pro target.\\
\\
Adopt settings of firewall at Apertis Pro:
\begin{itemize}
\item Add new rule to allow DLT service at port \textbf{3490} (as default)\\
Edit \rlog{/etc/iptables/rules.v4} file to add below line
\begin{robotlisting}
...
# Accept dlt for development
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3490 -j ACCEPT
...
\end{robotlisting}

\item Restart the firewall with changed parameters\\
\rlog{sudo systemctl restart iptables.service}
\end{itemize}

\subsection{DLTSelfTestApp}
\href{https://sourcecode.socialcoding.bosch.com/projects/ROBFW/repos/selftest/browse/helpers/DLT}
{DLTSelfTestApp} is an application which will be run on the Apertis Pro target for
testing the DLT connection between Robotframework AIO and target.\\
This package is a part of Robotframework Selftest helpers.\\
To install \textbf{DLTSelfTestApp}, download its debian package on Apertis Pro
target then execute the below command.\\
\rlog{sudo dpkg -i <path/to/dltselftestapp_1.0.0_amd64.deb>}\\
\\
\textbf{DLTSelfTestApp} application will be installed in
\rlog{/opt/bosch/robfw/dlt} directory and can be started with below command:\\
\rlog{/opt/bosch/robfw/dlt/DLTSelfTestApp}\\
\\
Welcome log message \rlog{Welcome to Robotframework AIO DLTSelfTestApp...}
will be sent at application startup.\\
Then the ping log \rlog{ping message from Robotframework AIO DLTSelfTestApp}
every 5 seconds.\\
\\
\textbf{\underline{DLT command injection:}}\\
To perform the DLT command injection, use below information:
\begin{itemize}
\item App ID: \textbf{RBFW}
\item Context ID: \textbf{TEST}
\item Service ID: \textbf{0x1000}
\item Data as Textdata
\end{itemize}

DLT log reponse of \textbf{DLTSelfTestApp} will bases on injected command:
\begin{itemize}
\item \rcode{welcome}: DLT reponse as above welcome message.
\item \rcode{exit}: DLT reponse as \rlog{Bye...} then \textbf{DLTSelfTestApp}
will be terminated.
\item Other commands: DLT reponse as combination of data and string.\\
e.g: \rlog{Data: 000000: 77 65 6c 63 6f 6d 65 31 32 31 32 00 xx xx xx xx
welcome1212}
\end{itemize}

\subsection{QConnectDLTLibrary}
\href{https://sourcecode.socialcoding.bosch.com/projects/ROBFW/repos/robotframework-qconnect-dlt/browse}
{QConnectDLTLibrary} is part of Robotframework AIO.\\
It provides the ability for handling connection to Diagnostic Log and
Trace(DLT) Module.
The library support for getting trace message and sending trace command\\
\\
Sample Robotframework testcase which are using \textbf{QConnectDLTLibrary} to
test DLTSelfTestApp on Apertis Pro target:
\begin{itemize}
\item Robot \rcode{Settings}(Setup, Teardown) and used \rcode{Variables},
\rcode{Keyword}
\begin{robotlisting}
*** Settings ***
Documentation This is selftest for DLT connection with DLTSelfTestApp
Library QConnectionLibrary.ConnectionManager
Suite Setup Open Connection
Suite Teardown Close Connection

*** Variables ***
${CONNECTION_NAME} TEST_CONN_DLTSelfTestApp
${DLT_CONNECTION_CONFIG} = SEPARATOR=
... {
... "gen3flex@DLTLSIMWFH": {
... "target_ip": "127.0.0.1",
... "target_port": 4490,
... "mode": 0,
... "ecu": "ECU1",
... "com_port": "COM1",
... "baudrate": 115200,
... "server_ip": "localhost",
... "server_port": 1234
... }
... }

*** Keywords ***
Close Connection
disconnect ${CONNECTION_NAME}
Log to console \nDLT connection has been closed!
Open Connection
${dlt_config} = evaluate json.loads('''${DLT_CONNECTION_CONFIG}''') json
connect conn_name=${CONNECTION_NAME}
... conn_type=DLT
... conn_mode=dltconnector
... conn_conf=${dlt_config}
Log to console \nDLT connection has been opened successfully!
\end{robotlisting}
\item Sample robot testcase to verify the ping message from DLTSelfTestApp
\begin{robotlisting}
*** Test Cases ***
Match log/trace from DLTSelfTestApp
[Documentation] Match log/trace from DLTSelfTestApp
[Tags] DLTSelfTestApp
${res}= verify conn_name=${CONNECTION_NAME}
... search_pattern=(DLT:0x01.*RBFW.*)
... timeout=6 # DLTSelfTestApp pings a message every 5 seconds
# log to console \n${res}[0]
# verify that reponse message should contain "Ping" keyword
Should Match Regexp ${res}[0] DLT:0x01.*RBFW.*Ping.*
\end{robotlisting}
\item Sample robot testcase to verify command injection with DLTSelfTestApp
\begin{robotlisting}
Command injection with DLTSelfTestApp
[Documentation] Get log/trace from DLTSelfTestApp
[Tags] DLTSelfTestApp
${res}= verify conn_name=${CONNECTION_NAME}
... search_pattern=(DLT:0x01.*RBFW.*Welcome.*)
... send_cmd=DLT_CALL_SW_INJECTION_ECU ECU1 1000 RBFW TEST 'welcome'
# log to console \n${res}[0]

${res}= verify conn_name=${CONNECTION_NAME}
... search_pattern=(DLT:0x01.*RBFW.*other_cmd.*)
... send_cmd=DLT_CALL_SW_INJECTION_ECU ECU1 1000 RBFW TEST 'other_cmd'

# log to console \n${res}[0]
\end{robotlisting}
\end{itemize}
Please refer \href{https://sourcecode.socialcoding.bosch.com/projects/ROBFW/repos/robotframework-qconnect-dlt/browse}
{QConnectDLTLibrary repository} for more details about usage and other
example testcase for DLT commection.
49 changes: 49 additions & 0 deletions book/include/code_analysis.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
% Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Code analysis}

The Robotframework AIO installation provides a static code analysis to detect potential errors and violations to coding conventions.
The name of the analyser is \textquotedbl{}Robocop\textquotedbl{}.

Start Eclipse and select a file or a folder in Project Explorer. A missing selection causes an error.

The External Tools menu provides three preconfigured settings to start the analysis (the numbering within the context menu
depends on the overall number of External Tools within your Eclipse configuration).

\includegraphics{./include/graphics/code_analysis/ExternalTools}

\includegraphics{./include/graphics/code_analysis/ContextMenu}

RF SCAn is the abbreviation for \textquotedbl{}\textbf{R}obot \textbf{F}ramework \textbf{S}tatic \textbf{C}ode \textbf{An}alysis\textquotedbl{}.

\textbf{1. RF SCAn (console)}
\begin{quote}
Output printed to console
\end{quote}

\textbf{2. RF SCAn (log file)}
\begin{quote}
Output printed to log file: \texttt{\%ROBOTLOGPATH\%\textbackslash{}Robocop.log}
\end{quote}

\textbf{3. TODO list (console)}
\begin{quote}
It is possible to use the string \texttt{TODO} in code comments to indicate that still something is \emph{todo}. But before a release all todo's should be resolved
(except there is a good and documented reason to keep the marker).
The static code analyser can be used to provide a list of all positions within your code, at which still such a \texttt{TODO} marker is present.
\end{quote}

\emph{Hint: The console displays a warning regarding rule '0906'. This warning can be ignored.}


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions book/include/our_document.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Library}
Document for the library
Binary file added evaluations/RF.Documentation.Concept.pptx
Binary file not shown.
Binary file added evaluations/RoboCop.Evaluation.xlsx
Binary file not shown.
20 changes: 20 additions & 0 deletions styles/include/inline.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
% Copyright 2020-2022 Robert Bosch Car Multimedia GmbH
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
\chapter{Robot code and log inline}


This is some text with \rcode{log To Console Hello RobotFW AIO} inline Robot code.
\\
\\
This is some text with \rlog{>git status} inline log.
Loading

0 comments on commit 78dcf06

Please sign in to comment.