# Hands-on Practice3 {%hackmd 48QQ4miqSxmUyp2CZ-kBSw %} ## 測試步驟 :::info :heart: 這裡只是測試步驟,真正的題目在下一段[**說明**](#說明),看完測試步驟先往下看,就知道要做什麼了。 ::: - Requirement: 5G-TAU(機器的型號)具備firewall malformed packets log功能,可以根據severity紀錄將log記在flasy, syslog或是snmp trap。 - 測項名稱: Firewall Malformed Packets Log Setting 1. 出發事件: 1. 設firewall malformed packets log規則為 | item | value | | -------- | ------- | | severity | 1 | | flash | disable | | syslog | enable | | trap | enable | 3. 查看cellular資訊 2. 預期結果: firewall資訊中應該包含下列內容 ```bash= Malformed Packets Severity :<1> Alert Flash :Disable Syslog :Enable Trap :Enable ``` - 參考command ```bash= # 設定firewall malformed packets log規則 configure terminal firewall malformed logging severity 1 no firewall malformed logging flash firewall malformed logging syslog firewall malformed logging trap exit # 查看cellular資訊 show firewall ``` ## 說明 - 目的: - 學習step讀table和string block的撰寫規則。 - 學習`git merge`和修改衝突。 - 學習發送`merge request`。 - 根據[測試步驟](#測試步驟)完成Test Case。 :::info :heart: 還是有點不清楚嗎?繼續照步驟做到,你就會更清楚了! ::: ## 更新Local Repo :::info :bulb: 之前提過的步驟之後就不再贅述,可以回去參考前面的Practice和相關的Q&A。 ::: 1. 下載repo/commit - 若還未載過repo,須從remote(`http://mhqnetgitlab.moxa.com:10080/SimonWX_Zhao/auto-test-practice.git`)下載(clone)repo - 如果已經載過repo那麼只需從remote下載新的commits 2. 檢查tag,包含`practice3-c`和`practice3-ans-c`就對了。 ## 練習Merge 1. checkout到帶有`practice3-c`tag的commit。 2. 確認現在位置在,`HEAD`和`tag: practice3-c`在同位置就對了。 3. 從這個commit新增一個名為`practice3-c-<你的名字>`的branch並移動到該branch上。 ```bash= git checkout -b practice3-c-<你的名字> ``` 4. 確認現在位置在,`HEAD`指到`practice3-c-<你的名字>`就對了。 5. 此時打開`firewall.feature`看一下提示,==記下那組神秘數字:exclamation:==  6. 將神祕的branch merge到現在的branch(practice3-c-<你的名字>),你會收到衝突的提示。 ```bash= git merge --no-ff origin/mock-branch-<神秘數字> ``` 衝突提醒  7. 先打開`steps/firewall.py`,衝突的部分會被一下符號框住。 ``` <<<<<<< HEAD ======= >>>>>>> mock-branch-<神秘數字> ```  8. 嘗試手動解決,把紅色線的地方刪除。  變這樣  9. ==然後儲存變更。== 10. 再打開`firewall.feature`,衝突的部分一樣被以下符號框住。 ``` <<<<<<< HEAD ======= >>>>>>> mock-branch-<神秘數字> ```  11. 這次我們用VSCode的功能修正,點「Accept Incoming Change」  12. ==然後儲存變更。== 13. 然後看一下`git status`,會提示排除conflicts之後要做commit。  14. 將變更commit,忘記了可以參考Q&A/Git,不贅述。但這次commit==故意不用`-m`增加commit資訊==,會跳出下列畫面,已經幫你打好commit的。  15. 按一下`Esc`鍵後按一下英文的`:`注意你的左下角應該也出現冒號,然後再打`wq`後按一下`Enter`,會出現commit的資訊。  commit的資訊  16. 看一下你的圖形化log,這次不要用`--all`,你會發現所處名為`practice3-c-<你的名字>`的分支有來自名為`mock-branch-<神秘數字>`分支的交點,這樣就對了。  17. 如果都對了就把你的branch push到remote吧! ```bash= git push --set-upstream origin practice3-c-<你的名字> ``` ## Practice3 Cucumber 1. 開始解題,並將你的更動[做commit](/H1voIxJwSA2f5gSs_xfDMQ#git-commit) 2. 執行結果 ```bash= #用"-n"指定要執行的測項名稱 behave -n "Firewall Malformed Packets Log Setting" -f html -o result/log.html -f pretty ``` 3. 檢查執行結果 - terminal  - log.html  4. 與標有`practice3-ans-c`的[commit比較](/H1voIxJwSA2f5gSs_xfDMQ#git-diff),主要測試步驟沒有多或少就對了! 5. 確定完成後記得做最後的commit且,==再將該branch所有commit推到remote,因為我們要練習做Code Review囉!== ## Merge Request 1. 到[GitLab/SimonWX_Zhao/ Aauto_test_practice](http://mhqnetgitlab.moxa.com/SimonWX_Zhao/auto-test-practice) 2. 點開「Merge Requests」  3. New merge request  4. 設定成將你的branch merge 到指定的branch。  5. 填入標題和參考資訊,確認無誤後送出。  6. ==接下來就留意信箱,等回復囉!== :construction_worker: 收到email的圖  7. 打開GitLab的畫面 :construction_worker: 補圖  --- :::info :heart: **感謝共同編輯** Sabrina、Alison :::
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up