提交 6147c8f7 编写于 作者: Z zhangxingxia

update securitylabel xts

Signed-off-by: Nzhangxingxia <zhangxingxia1@huawei.com>
上级 6de428ba
...@@ -37,7 +37,7 @@ describe('securitylabel', function () { ...@@ -37,7 +37,7 @@ describe('securitylabel', function () {
securityLabel.setSecurityLabelSync(fpath, dataLevel[i]); securityLabel.setSecurityLabelSync(fpath, dataLevel[i]);
let level = securityLabel.getSecurityLabelSync(fpath); let level = securityLabel.getSecurityLabelSync(fpath);
expect(level == dataLevel[i]).assertTrue(); expect(level == dataLevel[i]).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
} }
} catch (e) { } catch (e) {
...@@ -63,7 +63,7 @@ describe('securitylabel', function () { ...@@ -63,7 +63,7 @@ describe('securitylabel', function () {
} catch (err) { } catch (err) {
console.log('securitylabel_test_set_security_label_sync_001 has failed for ' + err); console.log('securitylabel_test_set_security_label_sync_001 has failed for ' + err);
expect(err.message == "Invalid Argument of dataLevelEnum").assertTrue(); expect(err.message == "Invalid Argument of dataLevelEnum").assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
} }
}); });
...@@ -103,7 +103,7 @@ describe('securitylabel', function () { ...@@ -103,7 +103,7 @@ describe('securitylabel', function () {
} catch (err) { } catch (err) {
console.log('securitylabel_test_set_security_label_sync_003 has failed for ' + err); console.log('securitylabel_test_set_security_label_sync_003 has failed for ' + err);
expect(err.message == "Invalid dataLevel").assertTrue(); expect(err.message == "Invalid dataLevel").assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
} }
}); });
...@@ -124,7 +124,7 @@ describe('securitylabel', function () { ...@@ -124,7 +124,7 @@ describe('securitylabel', function () {
} catch (err) { } catch (err) {
console.log('securitylabel_test_set_security_label_sync_004 has failed for ' + err); console.log('securitylabel_test_set_security_label_sync_004 has failed for ' + err);
expect(err.message == "Number of arguments unmatched").assertTrue(); expect(err.message == "Number of arguments unmatched").assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
} }
}); });
...@@ -145,7 +145,7 @@ describe('securitylabel', function () { ...@@ -145,7 +145,7 @@ describe('securitylabel', function () {
securityLabel.setSecurityLabel(fpath, 's0', function (err) { securityLabel.setSecurityLabel(fpath, 's0', function (err) {
securityLabel.getSecurityLabel(fpath, function (err, dataLevel) { securityLabel.getSecurityLabel(fpath, function (err, dataLevel) {
expect(dataLevel == 's0').assertTrue(); expect(dataLevel == 's0').assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
done(); done();
}) })
}) })
...@@ -172,7 +172,7 @@ describe('securitylabel', function () { ...@@ -172,7 +172,7 @@ describe('securitylabel', function () {
securityLabel.setSecurityLabel(fpath, 's1', async function (err) { securityLabel.setSecurityLabel(fpath, 's1', async function (err) {
let dataLevel = await securityLabel.getSecurityLabel(fpath); let dataLevel = await securityLabel.getSecurityLabel(fpath);
expect(dataLevel == 's1').assertTrue(); expect(dataLevel == 's1').assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
done(); done();
}) })
} catch (e) { } catch (e) {
...@@ -198,7 +198,7 @@ describe('securitylabel', function () { ...@@ -198,7 +198,7 @@ describe('securitylabel', function () {
await securityLabel.setSecurityLabel(fpath, 's2'); await securityLabel.setSecurityLabel(fpath, 's2');
securityLabel.getSecurityLabel(fpath, function (err, dataLevel) { securityLabel.getSecurityLabel(fpath, function (err, dataLevel) {
expect(dataLevel == 's2').assertTrue(); expect(dataLevel == 's2').assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
done(); done();
}) })
} catch (e) { } catch (e) {
...@@ -224,7 +224,7 @@ describe('securitylabel', function () { ...@@ -224,7 +224,7 @@ describe('securitylabel', function () {
await securityLabel.setSecurityLabel(fpath, 's3'); await securityLabel.setSecurityLabel(fpath, 's3');
let dataLevel = await securityLabel.getSecurityLabel(fpath); let dataLevel = await securityLabel.getSecurityLabel(fpath);
expect(dataLevel == 's3').assertTrue(); expect(dataLevel == 's3').assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
done(); done();
} catch (e) { } catch (e) {
console.log('securitylabel_test_set_security_label_async_003 has failed for ' + e); console.log('securitylabel_test_set_security_label_async_003 has failed for ' + e);
...@@ -249,7 +249,7 @@ describe('securitylabel', function () { ...@@ -249,7 +249,7 @@ describe('securitylabel', function () {
await securityLabel.setSecurityLabel(fpath, 's4'); await securityLabel.setSecurityLabel(fpath, 's4');
let dataLevel = await securityLabel.getSecurityLabel(fpath); let dataLevel = await securityLabel.getSecurityLabel(fpath);
expect(dataLevel == 's4').assertTrue(); expect(dataLevel == 's4').assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath));
done(); done();
} catch (e) { } catch (e) {
console.log('securitylabel_test_set_security_label_async_004 has failed for ' + e); console.log('securitylabel_test_set_security_label_async_004 has failed for ' + e);
...@@ -375,7 +375,7 @@ describe('securitylabel', function () { ...@@ -375,7 +375,7 @@ describe('securitylabel', function () {
await securityLabel.setSecurityLabel(fpath); await securityLabel.setSecurityLabel(fpath);
} catch (err) { } catch (err) {
console.log('securitylabel_test_set_security_label_async_010 has failed for ' + err); console.log('securitylabel_test_set_security_label_async_010 has failed for ' + err);
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
expect(err.message == "Number of arguments unmatched").assertTrue(); expect(err.message == "Number of arguments unmatched").assertTrue();
done(); done();
} }
...@@ -400,7 +400,7 @@ describe('securitylabel', function () { ...@@ -400,7 +400,7 @@ describe('securitylabel', function () {
}) })
} catch (err) { } catch (err) {
console.log('securitylabel_test_set_security_label_async_011 has failed for ' + err); console.log('securitylabel_test_set_security_label_async_011 has failed for ' + err);
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
expect(err.message == "Number of arguments unmatched").assertTrue(); expect(err.message == "Number of arguments unmatched").assertTrue();
done(); done();
} }
...@@ -558,7 +558,7 @@ describe('securitylabel', function () { ...@@ -558,7 +558,7 @@ describe('securitylabel', function () {
}); });
} catch (err) { } catch (err) {
console.log('securitylabel_test_get_security_label_async_003 has failed for ' + err); console.log('securitylabel_test_get_security_label_async_003 has failed for ' + err);
expect(fileio.unlinkSync(fpath) == null).assertTrue(); fileio.unlinkSync(fpath);
expect(err.message == "Number of arguments unmatched").assertTrue(); expect(err.message == "Number of arguments unmatched").assertTrue();
done(); done();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册