]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: sandbox: add test for erase command
authorPatrick Delaunay <patrick.delaunay@st.com>
Tue, 28 Jul 2020 09:51:27 +0000 (11:51 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 31 Jul 2020 14:13:00 +0000 (10:13 -0400)
Add test for the erase command tested on ENV in EXT4.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
configs/sandbox64_defconfig
configs/sandbox_defconfig
configs/sandbox_flattree_defconfig
configs/sandbox_spl_defconfig
test/py/tests/test_env.py

index 8a142850bf18ec19c634649300d24d71a580d140..1228c497275ac7cc1cfd1646ac38e87c3e5e4133 100644 (file)
@@ -27,6 +27,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_ERASEENV=y
 CONFIG_CMD_ENV_CALLBACK=y
 CONFIG_CMD_ENV_FLAGS=y
 CONFIG_CMD_NVEDIT_EFI=y
index 0fce901f67f95da620a98f2be0501c05a6dfacff..f4f97f34ffa5f4d2e4196014a447b3e1cb700db8 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_CMD_ABOOTIMG=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_ERASEENV=y
 CONFIG_CMD_ENV_CALLBACK=y
 CONFIG_CMD_ENV_FLAGS=y
 CONFIG_CMD_NVEDIT_EFI=y
index e91e9def236c568b9603aa8a1ade7d7bc004002a..78d732d0bcb29dc9182ca2620be152ce4fe279ae 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_ERASEENV=y
 CONFIG_CMD_NVEDIT_INFO=y
 CONFIG_CMD_NVEDIT_LOAD=y
 CONFIG_CMD_NVEDIT_SELECT=y
index 5298b78d6d530d5cc92081d7fd82f441ae600b75..b846487f235868794136594c8ab0b446727a01d0 100644 (file)
@@ -34,6 +34,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_ERASEENV=y
 CONFIG_CMD_ENV_CALLBACK=y
 CONFIG_CMD_ENV_FLAGS=y
 CONFIG_CMD_NVEDIT_INFO=y
index 70913c8d9abc4d6af17fde9ae55168cfdb859136..86ec1b36d36e4b789ffac7829209f4efd3ce5bd7 100644 (file)
@@ -475,6 +475,22 @@ def test_env_ext4(state_test_env):
         response = c.run_command('echo $?')
         assert response == "0"
 
+        response = c.run_command('env erase')
+        assert 'OK' in response
+
+        response = c.run_command('env load')
+        assert 'Loading Environment from EXT4... ' in response
+        assert 'bad CRC, using default environment' in response
+
+        response = c.run_command('env info')
+        assert 'env_valid = invalid' in response
+        assert 'env_ready = true' in response
+        assert 'env_use_default = true' in response
+
+        response = c.run_command('env info -p -d')
+        assert 'Default environment is used' in response
+        assert 'Environment can be persisted' in response
+
         # restore env location: NOWHERE (prio 0 in sandbox)
         response = c.run_command('env select nowhere')
         assert 'Select Environment on nowhere: OK' in response