mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-04 15:04:25 +01:00
qemu: enable "-pflash"
flash image can store some critical data like firmware, enable it here. Fixes: #140 Signed-off-by: Edmond AK Dantes <edmond.dantes.ak47@outlook.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -1026,6 +1027,25 @@ func TestBadGlobalParam(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadPFlash(t *testing.T) {
|
||||
c := &Config{}
|
||||
c.appendPFlashParam()
|
||||
if len(c.qemuParams) != 0 {
|
||||
t.Errorf("Expected empty qemuParams, found %s", c.qemuParams)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidPFlash(t *testing.T) {
|
||||
c := &Config{}
|
||||
c.PFlash = []string{"flash0", "flash1"}
|
||||
c.appendPFlashParam()
|
||||
expected := []string{"-pflash", "flash0", "-pflash", "flash1"}
|
||||
ok := reflect.DeepEqual(expected, c.qemuParams)
|
||||
if !ok {
|
||||
t.Errorf("Expected %v, found %v", expected, c.qemuParams)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadVGA(t *testing.T) {
|
||||
c := &Config{}
|
||||
c.appendVGA()
|
||||
|
||||
Reference in New Issue
Block a user